Important: The information in this document is obsolete and should not be used for new development.
FixATan2
You can use theFixATan2
function 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
, orFract
number.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
x
parameter.DESCRIPTION
TheFixATan2
function 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.