trig(3M)
NAME
trig, sin, cos, tan, asin, acos, atan, atan2 − trigonometric functions
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(x), cos(x) and tan(x) return trigonometric functions of radian arguments. Trigonometric argument reduction is discussed in the
asin(x) returns the arc sine of x in the range −π/2 to π/2.
acos(x) returns the arc cosine of x in the range 0 to π.
atan(x) returns the arc tangent of x in the range −π/2 to π/2.
atan2(y,x) and hypot(x,y) (see hypot(3M)) convert rectangular coordinates (x,y) to polar (r,θ); atan2(y,x) computes θ, the argument or phase, by computing an arc tangent of y/x in the range −π to π. atan2(0.0,0.0) is 0.0, in conformance with SVID.
DIAGNOSTICS
These functions handle exceptional arguments in the spirit of ANSI/IEEE Std 754-1985 and in conformance with SVID. sin(±∞), cos(±∞) and tan(±∞) return NaN; asin(x) or acos(x) with |x|>1, return 0.0. In addition, asin(x), acos(x), and atan2(y,x) may also set errno and call matherr(3M).
SEE ALSO
SunOS 5.1 — Last change: 30 Apr 1992