Table of Contents

Property Centroid

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Centroid

Gets the centroid of the polygon area.

public GeoPoint3 Centroid { get; }

Property Value

GeoPoint3

Remarks

This is the centre of mass of the filled shape, not the average of the vertices. The two agree only for a shape whose vertices are spread evenly, and the average is not a useful answer for a polygon with several vertices clustered along one edge.

Each triangle of the fan is weighted by its area signed against the polygon normal, not by its plain area. For a concave polygon parts of the fan reach outside the boundary, and they are wound the other way; their negative weight is exactly what cancels them out again. Using the unsigned area would count that overhang as material and pull the answer towards it.