trig(3M) UNIX System V(Math Libraries) trig(3M)
NAME
trig: sin, sinf, cos, cosf, tan, tanf, asin, asinf, acos, acosf, atan,
atanf, atan2, atan2f - trigonometric functions
SYNOPSIS
cc [flag ...] file ... -lm [library ...]
cc -O -Ksd [flag ...] file ... -J sfm [library ...]
#include <math.h>
double sin (double x);
float sinf (float x);
double cos (double x);
float cosf (float x);
double tan (double x);
float tanf (float x);
double asin (double x);
float asinf (float x);
double acos (double x);
float acosf (float x);
double atan (double x);
float atanf (float x);
double atan2 (double y, double x);
float atan2f (float y, float x);
DESCRIPTION
sin, cos, and tan and the single-precision versions sinf, cosf, and tanf
return, respectively, the sine, cosine, and tangent of their argument, x,
measured in radians.
asin and asinf return the arcsine of x, in the range [-π/2,+π/2].
acos and acosf return the arccosine of x, in the range [0,+π].
atan and atanf return the arctangent of x, in the range (-π/2,+π/2).
10/89 Page 1
trig(3M) UNIX System V(Math Libraries) trig(3M)
atan2 and atan2f return the arctangent of y/x, in the range (-π,+π],
using the signs of both arguments to determine the quadrant of the return
value.
SEE ALSO
matherr(3M).
DIAGNOSTICS
If the magnitude of the argument of asin, asinf, acos, or acosf is
greater than 1, or if both arguments of atan2 or atan2f are 0, 0 is
returned and errno is set to EDOM. In addition, a message indicating
DOMAIN error is printed on the standard error output.
Except when the -Xc compilation option is used, these error-handling
procedures may be changed with the function matherr. When the -Xa or -Xc
compilation options are used, no error messages are printed.
Page 2 10/89