FixATan2You can use the
FixATan2function to obtain a fast approximation of the arctangent of a fraction.
FUNCTION FixATan2 (x, y: LongInt): Fixed;
- The numerator of the fraction whose arctangent is to be obtained. This variable can be a
- 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
FixATan2function returns, in radians, the arctangent of
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.