Important: The information in this document is obsolete and should not be used for new development.
AngleFromSlope
You can convert a slope value to an angle value using theAngleFromSlope
function.
FUNCTION AngleFromSlope (slope: Fixed): Integer;
slope
- The slope, defined as Dx/Dy, which is the horizontal change divided by the vertical change between any two points on a line with the slope.
DESCRIPTION
TheAngleFromSlope
function returns the angle corresponding to the slope specified in theslope
parameter treatedMOD
180. Angles are defined in clockwise degrees from 12 o'clock. The negative y-axis is defined as being at 12 o'clock, and the positive y-axis at 6 o'clock. The x-axis is defined as usual, with the positive side defined as being at 3 o'clock.SPECIAL CONSIDERATIONS
TheAngleFromSlope
function is most useful when you require speed more than accuracy in performing the calculation. The integer result is within 1 degree of the correct answer, but not necessarily within half a degree.SEE ALSO
For an example of the use of theAngleFromSlope
function, see Figure 3-7 on page 3-13.