Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 3 - Mathematical and Logical Utilities / Mathematical and Logical Utilities Reference
Routines / Converting Between Angle and Slope Values


You can convert an angle value to a slope value using the SlopeFromAngle function.

FUNCTION SlopeFromAngle (angle: Integer): Fixed;
The angle, expressed in clockwise degrees from 12 o'clock and treated MOD 180. (90 degrees is thus at 3 o'clock and -90 degrees is at 9 o'clock.)
The SlopeFromAngle function returns the slope corresponding to the angle specified in the angle parameter. Slopes are defined as Dx/Dy, the horizontal change divided by the vertical change between any two points on a line with the given angle. 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.

For an example of the use of the SlopeFromAngle function, see Figure 3-7 on page 3-13.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice