gelatin-0.0.0.3: An experimental real time renderer.

Safe HaskellNone
LanguageHaskell2010

Gelatin.Core.Triangulation.Common

Synopsis

Documentation

type Poly = [V2 Float] Source

signedArea :: Num a => [V2 a] -> a Source

signedAreaOfPoints :: Num a => [V2 a] -> a Source

rotateLeft :: [a] -> [a] Source

insidePoly :: Poly -> Poly -> Bool Source

returns True iff the first point of the first polygon is inside the second poylgon

pointInside :: V2 Float -> Poly -> Bool Source

A point is inside a polygon if it has an odd number of intersections with the boundary (Jordan Curve theorem)

pathHasPoint :: (R1 f, R2 f, Ord a, Fractional a) => [f a] -> f a -> Bool Source

Determine if a point lies within a polygon path using the even/odd rule.

cycleNeighbours :: [a] -> [[a]] Source

return a list containing lists of every element with its neighbour i.e. [e1,e2,e3] -> [ [e1,e2], [e2,e3], [e3, e1] ]

cycleN :: a -> [a] -> [[a]] Source

triangleArea :: Fractional a => V2 a -> V2 a -> V2 a -> a Source