Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions


Trigonometric Functions

MathLib provides the following trigonometric functions:
cos(x) Computes the cosine of x.
sin(x) Computes the sine of x.
tan(x) Computes the tangent of x.
acos(x) Computes the arc cosine of x.
asin(x) Computes the arc sine of x.
atan(x) Computes the arc tangent of x.
atan2(y,x) Computes the arc tangent of y/x.

The remaining trigonometric functions can be computed easily and efficiently from the transcendental functions provided.

The arguments for trigonometric functions (cos, sin, and tan) and return values for inverse trigonometric functions (acos, asin, atan, and atan2) are expressed in radians. The cosine, sine, and tangent functions use an argument reduction based on the remainder function (see page 6-11 in Chapter 6, "Numeric Operations and Functions") and the constant pi, where pi is the nearest approximation of \x86 with 53 bits of precision. The cosine, sine, and tangent functions are periodic with respect to the constant pi, so their periods are different from their mathematical counterparts and diverge from their counterparts when their arguments become very large.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996