Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Earclipper.EarClipping
Description
Ear clipping triangulation
- toTriangle :: [(Double, Double)] -> [[(Double, Double)]]
- triangulate :: [(Double, Double)] -> [[(Double, Double)]]
- pointInTriangle :: [(Double, Double)] -> (Double, Double) -> Bool
- isAnyPointInTriangle :: [(Double, Double)] -> [(Double, Double)] -> Bool
- isConvex :: (Double, Double) -> (Double, Double) -> (Double, Double) -> Bool
Documentation
toTriangle :: [(Double, Double)] -> [[(Double, Double)]] Source #
Triangulate given polygon and return a list of triangles. The given polygon's start point end end point has to be equal. The first point is removed before triangulation. Use the triangulate function if you want to supply a polygon directly without modification.
triangulate :: [(Double, Double)] -> [[(Double, Double)]] Source #
Triangulate given polygon and return a list of triangles. It is assumed that the given polygon's end point is the start point and that the first point in the list is not the start point.
pointInTriangle :: [(Double, Double)] -> (Double, Double) -> Bool Source #
Check if given point is in given triangle.