CImage:AngleWcs

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.

Syntax

nAngle = CImage:Angle( x1, y1, x2, y2)

Remarks

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.

Example

Assume an image is displayed and attached to a CImageView named V. The following script fragment measures the angle formed by two points (x1,y1) and (x2,y2) when the coordinates are in pixel units:

 

I = V:GetImage()

-- load the image from a

x1 = 442.5 ; y1 = 220.44

-- point 1

x2 = 1.554 ; y2 = 20.552

-- point 2

A = I:Angle(x1,y1,x2,y2)

-- make the measurement

Related Topics

CImage, AngleWcs, Angle Measurement Definition