Method PolygonCentroid2D
PolygonCentroid2D(List<Vector3>)
Given a list of vertices of a 2d convex polygon, find the centroid of the polygon. This implementation operates only on the X and Z axes.
Declaration
public static Vector3 PolygonCentroid2D(List<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
List<Vector3> | vertices | Vertices defining the outline of a 2D polygon. |
Returns
Type | Description |
---|---|
Vector3 | The centroid point for the polygon. |