CogPolygon AreaCenter Method Cognex VisionPro 9.8
Compute the centroid of this polygon. Generates an error if there are fewer than 3 vertices.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.1.0.0
Syntax

public void AreaCenter(
	out double x,
	out double y
)

Parameters

x
Type: System Double 

X-coordinate of the center.

y
Type: System Double 

Y-coordinate of the center.

Exceptions

Remarks

Computes the centroid of this polygon. The polygon must have at least three vertices.

If the polygon is Complex, the value that AreaCenter(Double , Double ) computes will not be valid, but AreaCenter(Double , Double ) will not return an error. For Complex polygons use ArcCenter(Double , Double ) instead.

See Also