TRIG(S) XENIX System V TRIG(S)
Name
sin, cos, tan, asin, acos, atan, atan2 - Performs
trigonometric functions.
Syntax
#include <math.h>
double sin (x)
double x;
double cos (x)
double x;
double tan (x)
double x;
double asin (x)
double x;
double acos (x)
double x;
double atan (x)
double x;
double atan2 (y, x)
double x, y;
Description
sin, cos and tan return trigonometric functions of radian
arguments. The magnitude of the argument should be checked
by the caller to make sure the result is meaningful.
asin returns the arc sin in the range -/2 to /2.
acos returns the arc cosine in the range 0 to .
atan returns the arc tangent of x in the range -/2 to /2.
atan2 returns the arc tangent of y/x in the range - to .
See Also
matherr(S)
Diagnostics
sin, cos, and tan lose accuracy when their argument is far
from zero. For arguments sufficiently large, these
functions return zero when there would otherwise be a
complete loss of significance. In this case, a message
indicating a TLOSS error is displayed on the standard error
output. For less extreme arguments causing partial loss of
significance, a PLOSS error is generated but no error
Page 1 (printed 8/7/87)
TRIG(S) XENIX System V TRIG(S)
message is displayed. In both cases, errno is set to
ERANGE.
If the magnitude of the argument of asin or acos is greater
than one, or if both arguments of atan2 are zero, zero is
returned and errno is set to EDOM. In addition, a message
indicating a DOMAIN error is displayed on the standard error
output.
These error-handling procedures may be changed with the
matther(S) function.
Notes
These routines must be linked with the -lm linker option.
Page 2 (printed 8/7/87)