Important: The information in this document is obsolete and should not be used for new development.
|
|
Log In | Not a Member? |
Contact ADC |
FixATan2
You can use theFixATan2function to obtain a fast approximation of the arctangent of a fraction.
FUNCTION FixATan2 (x, y: LongInt): Fixed;
x- The numerator of the fraction whose arctangent is to be obtained. This variable can be a
LongInt,Fixed, orFractnumber.y- The denominator of the fraction whose arctangent is to be obtained. The number supplied in this variable must be of the same type as that of the number supplied in the
xparameter.DESCRIPTION
TheFixATan2function returns, in radians, the arctangent ofy/x.The approximation of Pi/4 used to compute the arctangent is the hexadecimal value 0.C910, making the approximation of Pi equal to 3.1416015625, while Pi itself equals 3.14159265.... Thus
FixATan2(1, 1)equals the equivalent of the hexadecimal value 0.C910. Despite the approximation of Pi, the arctangent value obtained will usually be correct to several decimal places.
Get information on Apple products.
Visit the Apple Store online or at retail locations. 1-800-MY-APPLE Copyright © 2007 Apple Inc. All rights reserved. | Terms of use | Privacy Notice |