Example

Make a Random Convex Polygon

geometric.polygonRandom([sides[, area[, centroid]]]) returns the vertices of a random convex polygon of the specified number of sides, area, and centroid coordinates. If sides is not specified, defaults to 3. If area is not specified, defaults to 100. If centroid is not specified, defaults to [0, 0]. The returned polygon's winding order will be counter-clockwise. Based on an algorithm by Pavel Valtr and an implementation by Maneesh Agrawala.

Adjust the controls to change the random polygon's sides, area, center, and rotation.

Code