Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Poly = [V2 Float]
- signedArea :: Num a => [V2 a] -> a
- signedAreaOfPoints :: Num a => [V2 a] -> a
- rotateLeft :: [a] -> [a]
- insidePoly :: Poly -> Poly -> Bool
- pointInside :: V2 Float -> Poly -> Bool
- pathHasPoint :: (R1 f, R2 f, Ord a, Fractional a) => [f a] -> f a -> Bool
- cycleNeighbours :: [a] -> [[a]]
- cycleN :: a -> [a] -> [[a]]
- triangleArea :: Fractional a => V2 a -> V2 a -> V2 a -> a
Documentation
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] ]
triangleArea :: Fractional a => V2 a -> V2 a -> V2 a -> a Source