Copyright | (c) 2014 diagrams-lib team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
Special functions for points in R2.
- convexHull2D :: OrderedField n => [P2 n] -> [P2 n]
- sortedConvexHull :: OrderedField n => [P2 n] -> ([P2 n], [P2 n])
Documentation
convexHull2D :: OrderedField n => [P2 n] -> [P2 n] Source #
Find the convex hull of a list of points using Andrew's monotone chain algorithm O(n log n).
Returns clockwise list of points starting from the left-most point.
sortedConvexHull :: OrderedField n => [P2 n] -> ([P2 n], [P2 n]) Source #
Find the convex hull of a set of points already sorted in the x direction. The first list of the tuple is the upper hull going clockwise from left-most to right-most point. The second is the lower hull from right-most to left-most in the anti-clockwise direction.