CogLine SetDistanceRotation Method Cognex VisionPro 9.10
Sets the X and Y properties of this line to the end of the vector (Distance, Rotation + 90 deg.) or (-Distance, Rotation - 90 deg.) for negative Distance. Sets the Rotation property to the specified Rotation.

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

public void SetDistanceRotation(
	double distance,
	double rotation
)

Parameters

distance
Type: System Double

The distance from the origin to the line.

rotation
Type: System Double

The line's rotation, measured in radians from the x-axis.

Remarks

Sets the reference point and rotation of the line based on a vector.

The reference point of the line is the end of the vector (distance, rotation + 90°). If distance is negative, the reference point is the end of the vector (-distance, rotation - 90°). rotation is specified in radians and normalized to the range -π to π.

You can also interpret the line as if it were parallel to the x-axis of a coordinate frame that is rotated rotation radians, and translated along the rotated y-axis by distance.

In the following figure, distance is 3 and rotation is 45° (π/2 radians).

And in the following figure, distance is -3 and rotation is 45° (π/2 radians).

See Also