NAME
- trig, sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions
SYNOPSIS
-
cc [ flag . . . ] file . . . -lm [ library . . . ]
-
-
#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);
MT-LEVEL
- MT-Safe
DESCRIPTION
-
sin(x), cos(x) and tan(x) return trigonometric functions of radian arguments. Trigonometric argument reduction is carried out with respect to the infinitely precise ..
-
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 ..
RETURN VALUES
- For exceptional cases, matherr(3M) tabulates the values to be returned as dictated by various Standards.
SEE ALSO
-
hypot(3M), matherr(3M)
DIAGNOSTICS
- In IEEE 754 mode (i.e. the --xlibmieee cc compilation option), these functions handle exceptional arguments in the spirit of ANSI/IEEE Std 754-1985. sin(.. ), cos(.. )and tan(.. )return NaN; asin(x) and acos(x) return NaN if |x|>1. atan(.. )returns ../2. For atan2( ),
-
atan2(.0, x )returns .0 for x > 0 or x = +0;
-
atan2(.0, x )returns .. for x < 0 or x = -0;
-
atan2(y ,.0 )returns ./2 for y > 0;
-
atan2(y ,.0 )returns -./2 for y < 0;
-
atan2(.y ,.) returns .0 for finite y > 0;
-
atan2(.. ,x )returns ../2 for finite x;
-
atan2(.y ,-. )returns .. for finite y > 0;
-
atan2(.. ,.) returns ../4;
-
atan2(.. ,-. )returns .3 ./4.
|