Carbon


FracCos

Header: FixMath.h Carbon status: Supported

Obtains a fast approximation of the cosine of a Fixed number.

Fract FracCos (
    Fixed x
);
x

The Fixed number expressed in radians, whose cosine is to be calculated.

function result

The cosine, expressed in radians, of the Fixed number x.0

DISCUSSION

The approximation of Pi/4 used to compute the cosine is the hexadecimal value 0.C910, making the approximation of Pi equal to 3.1416015625, while Pi itself equals 3.14159265.... Despite the approximation of Pi, the cosine value obtained is usually correct to several decimal places.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)