Compute the centroid of this polygon. Generates an error if there are fewer than 3 vertices.
Assembly: Cognex.Vision.Core.Net (in Cognex.Vision.Core.Net.dll) Version: 9.10.0.0
Syntax
Parameters
- x
- Type: System Double
X-coordinate of the center.
- y
- Type: System Double
Y-coordinate of the center.
Exceptions
| Exception | Condition |
|---|---|
| ShapeException | NumVertices < 3. |
Remarks
Computes the centroid of this polygon. The polygon must have at least three vertices. If the polygon is Complex, the value that AreaCenter() computes will not be valid, but AreaCenter() will not return an error. For Complex polygons use ArcCenter() instead.
See Also