CImage:Angle
The Angle method calculates the angle in degrees between a line formed by 2 image points measured in pixel coordinates. To measure an angle in world coordinates, use the AngleWcs method.
nAngle = CImage:Angle( x1, y1, x2, y2)
x1, y1,x2, y2 are pixel coordinate values and may be expressed as numbers or strings.
On success, this method returns nAngle as a number.
On failure, this method returns the default value 0.
The Angle method returns an angle in degrees. The angle is measured positive with increasing x value and increasing y value. For a discussion of angle and its measurement in different image types, see Angle Measurement Definition.
Assume an image is displayed and attached to a CImageView named V. The following script measures the angle formed by two points (x1,y1) and (x2,y2) when the coordinates are in pixel units:
|
-- load the image from a |
|
-- point 1 |
|
-- point 2 |
|
-- make the measurement |
CImage class, AngleWcs, Angle Measurement Definition
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.