diagrams-lib-1.4.2.3: Embedded domain-specific language for declarative graphics

Copyright(c) 2014 diagrams-lib team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.TwoD.Points

Description

Special functions for points in R2.

Synopsis

Documentation

convexHull2D :: OrderedField n => [P2 n] -> [P2 n] #

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]) #

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.