Example

Convex Hull

geometric.polygonHull(points) returns the convex hull, represented as a polygon, for an array of points. Returns null if the input array has fewer than three points. Uses Andrew’s monotone chain algorithm.

Click to add points and see polygonHull trace the convex hull around them.

Vertices

0

Click anywhere to begin.

Code