CogShapeModelLine DistanceToPoint Method Cognex VisionPro 9.8 SR1
Shortest distance from this shape to the given point.

Namespace: Cognex.VisionPro.Implementation.Internal
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.0.0.0
Syntax

public virtual double DistanceToPoint(
	double x,
	double y
)

Return Value

Type: Double

The distance from the point (x, y) to the shape.

Implements

ICogShape DistanceToPoint(Double, Double)
Remarks

Returns the shortest distance from this shape to the given point in the shape's selected coordinate space. Points within closed shapes return a distance less than zero.

The distance is measured to a meaningful part of the shape. For example, in measuring the distance to a CogPointMarker, only its center is considered meaningful, not the distance to one of the arms.

See Also