centroid

Function
centroid(vertices: Points2D) -> Point2D

Calculate the centroid (center of mass) of a set of vertices

Parameters

vertices
List of Point2D objects

Returns

Point2D centroid position