libmath-convexhull-monotonechain-perl

Perl module to calculate a convex hull using andrew's monotone chain algorithm
  https://metacpan.org/release/Math-ConvexHull-MonotoneChain/
  0
  no reviews



Math::convexhull::monotonechain optionally exports a single function convex_hull which calculates the convex hull of the input points and returns it. andrew's monotone chain convex hull algorithm constructs the convex hull of a set of 2-dimensional points in o(n*log(n)) time.

it does so by first sorting the points lexicographically (first by x-coordinate, and in case of a tie, by y-coordinate), and then constructing upper and lower hulls of the points in o(n) time. it should be somewhat faster than a plain graham's scan (also o(n*log(n))) in practice since it avoids polar coordinates.