Function: calculateCentroid()
calculateCentroid(
vertices):Vector2
Defined in: physics/shapes/polygon-math.ts:30
Calculates the centroid (center of mass, for a uniform-density polygon) of a simple polygon.
Parameters
vertices
readonly Vector2[]
The polygon's vertices, in order.
Returns
The centroid of the polygon.