CIGAL Reference Manual, Chapter 3 (Functions): ANGLE
usage: val = angle(v1,v2,v3,flg) ; angle V1 to V2 to V3
or: val = angle(v1, 0,v3,flg) ; use (0,0,0) as vertex
or: val = angle(x1,y1,x2,y2,x3,y3,flg)
or: val = angle(x1,y1,z1,x2,y2,z2,x3,y3,z3,flg)
or: val = angle(flg) ; get points interactively
The angle formed by moving from point 1 through point 2 to point 3 is calculated in degrees. The 3 points can be entered as 3 VECTOR variables (V1-V3), as 3 sets of coordinates in either 2-dimensions (x,y) or 3-dimensions (x,y,z), or interactively as 3 clicks of the cursor.
The FLG argument ignores 1 dimension (X, Y, or Z) when calculating an angle. Ignoring one axis is equivalent to calculating the angle of rotation about that axis. FLG values of 1, 2, or 3 ignore X, Y, or Z respectively. When the FLG value is zero the absolute value of the angle is given. If FLG is non-zero, the sign of the angle is based on a right-handed coordinate system, as follows:
Rotation axis Positive direction X Moving from +Y axis towards +Z axis Y Moving from +Z axis towards +X axis Z Moving from +X axis towards +Y axis
Example:
a = angle(3) ; get an angle in the X-Y plane (ignoring Z)
See Also:
ROTATE(2)