Class: ConvexHull

SQR. ConvexHull

Constructor

new ConvexHull()

utility to compute a convex hull. Based on algorithm from Chapter 1 in http://www.amazon.com/dp/3540779736/?tag=stackoverfl08-20 and code from http://blog.cedric.ws/draw-the-convex-hull-with-canvas-and-javascript which is basically the implementation of the algorithm explained in the book. Other links: http://www.travellermap.com/tmp/delaunay.js https://github.com/ironwallaby/delaunay/blob/master/delaunay.js http://paulbourke.net/papers/triangulate/
Source:

Methods

(static) compute(p, h) → {Array}

Parameters:
Name Type Description
p Array array of SQR.V2 or any objects that have a `x` and `y` property.
h Array the array to store the result in. If omitted, new one is created.
Source:
Returns:
array of SQR.V2 containing ordered points that make the convexhull.
Type
Array