Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
2D convex hull
The convex hull is calculated using Andrew's monotone chain algorithm.
Sources:
- https://cp-algorithms.com/geometry/convex-hull.html
- R. L. Graham, "An Efficient Algorithm for Determining the Convex Hull of a Finite Planar Set", 1972 https://www.math.ucsd.edu/~ronspubs/72_10_convex_hull.pdf
- A. M. Andrew, "Another efficient algorithm for convex hulls in two dimensions", 1979 https://www.sciencedirect.com/science/article/abs/pii/0020019079900723
Synopsis
- convexHull :: [V2] -> [V2]
Documentation
convexHull :: [V2] -> [V2] Source #
Calculates the convex hull for a set of points. The points should be distinct. The points on the hull are returned in clockwise order. O(n log n).