up | Inhaltsverzeichniss | Kommentar

Manual page for SIN(3M)

sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions and their inverses

SYNOPSIS

#include <math.h>

double sin(double x);

double cos(double x);

double tan(double x);

double asin(double x);

double acos(double x);

double atan(double x);

double atan2(double y, double x);

DESCRIPTION

Sin, cos and tan return trigonometric functions of radian arguments x.

Asin returns the arc sine in the range -\(*p/2 to \(*p/2.

Acos returns the arc cosine in the range 0 to

Atan returns the arc tangent in the range -\(*p/2 to \(*p/2.

Atan2 computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. The arc tangent returned is in the range [- \(*p , + \(*p ]

ERROR (due to roundoff, etc.)

Let P stand for the number stored in the computer in place of \(*p = 3.14159 26535 89793 23846 26433 ... . Let ``trig'' stand for one of ``sin'', ``cos'' or ``tan''. Then the expression ``trig(x)'' in a program actually produces an approximation to trig(x*\(*p/P), and ``atrig(x)'' approximates (P/\(*p)*atrig(x). The approximations are close. In the codes that run on other machines, P differs from \(*p by a fraction of an ulp; the difference matters only if the argument x is huge, and even then the difference is likely to be swamped by the uncertainty in x. Besides, every trigonometric identity that does not involve \(*p explicitly is satisfied equally well regardless of whether P = \(*p. For instance, sin2(x)+cos2(x) = 1 and sin(2x) = 2sin(x)cos(x) to within a few ulps no matter how big x may be. Therefore the difference between P and \(*p is most unlikely to affect scientific and engineering computations.

SEE ALSO

math(3M), hypot(3M), sinh(3M), sqrt(3M)

AUTHOR

Robert P. Corbett, W. Kahan, Stuart I. McDonald, Peter Tang and, for the codes for IEEE 754, Dr. Kwok-Choi Ng.


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97