Calculate the centroid non-self-intersecting closed polygon. If the polygon's area is zero, the first point of the polygon is returned, if it has at least on point, otherwise the point {x: 0, y: 0} is returned.
{x: 0, y: 0}
The points of the polygon
The centroid of the polygon
https://en.wikipedia.org/wiki/Centroid#Of_a_polygon
Calculate the centroid non-self-intersecting closed polygon. If the polygon's area is zero, the first point of the polygon is returned, if it has at least on point, otherwise the point
{x: 0, y: 0}is returned.