sin(3) Library Functions Manual sin(3)
NAME
sin, sind, cos, cosd, tan, tand, cot, cotd, asin, asind, acos, acosd,
atan, atand, atan2, atand2, sincos, sincosd - Trigonometric and inverse
trigonometric functions in radian and degree calculations.
LIBRARY
Math Library (libm.a)
SYNOPSIS
#include <math.h>
double sin (double x);
float sinf (float x);
double sind (double x);
float sindf (float x);
double cos (double x);
float cosf (float x);
double cosd (double x);
float cosdf (float x);
double tan (double x);
float tanf (float x);
double tand (double x);
float tandf (float x);
double cot (double x);
float cotf (float x);
double cotd (double x);
float cotdf (float x);
double asin (double x);
float asinf (float x);
double asind (double x);
float asindf (float x);
double acos (double x);
float acosf (float x);
double acosd (double x);
float acosdf (float x);
double atan (double x);
float atanf (float x);
double atand (double x);
float atandf (float x);
double atan2 (double y, double x);
float atan2f (float y, float x);
double atand2 (double y, double x);
float atand2f (float y, float x);
double_complex sincos (double x);
float_complex sincosf (float x);
double_complex sincosd (double x);
float_complex sincosdf (float x);
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
acos(): XPG4
asin(): XPG4
atan(): XPG4
atan2(): XPG4
cos(): XPG4
sin(): XPG4
tan(): XPG4
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
DESCRIPTION
The sin() and sinf() functions compute the sine of x, measured in radi-
ans.
The sind() and sindf() functions compute the sine of x, measured in de-
grees.
The cos() and cosf() functions compute the cosine of x, measured in ra-
dians.
The cosd() and cosdf() functions compute the cosine of x, measured in
degrees.
The tan() and tanf() functions compute the tangent of x, measured in
radians.
The tand() and tandf() functions compute the tangent of x, measured in
degrees.
The cot() and cotf() functions compute the cotangent of x, measured in
radians.
The cotd() and cotdf() functions compute the cotangent of x, measured
in degrees.
The asin() and asinf() functions compute the principal value of the arc
sine of x in the interval [-pi/2,pi/2] radians. The value of x must be
in the domain [-1,1].
The asind() and asindf() functions compute the principal value of the
arc sine of x in the interval [-90,90] degrees. The value of x must be
in the domain [-1,1].
The acos() and acosf() functions compute the principal value of the arc
cosine of x in the interval [0,pi] radians. The value of x must be in
the domain [-1,1].
The acosd() and acosdf() functions compute the principal value of the
arc cosine of x in the interval [0,180] degrees. The value of x must be
in the domain [-1,1].
The atan() and atanf() functions compute the principal value of the arc
tangent of x in the interval [-pi/2,pi/2] radians.
The atand() and atandf() functions compute the principal value of the
arc tangent of x in the interval [-90,90] degrees.
The atan2() and atan2f() functions compute the principal value of the
arc tangent of y/x, in the interval [-pi,pi] radians. The sign of
atan2() and atan2f() is determined by the sign of y. The value of
atan2(y,x) is computed as follows where f is the number of fraction
bits associated with the data type. tab(@); lfHB lfHB l l . _
Value of Input Arguments@Angle Returned
_
x = 0 or y/x > 2**(f+1)@pi/2 * (sign y)
x > 0 and y/x <= 2**(f+1)@atan(y/x)
x < 0 and y/x <= 2**(f+1)@pi * (sign y) + atan(y/x) _
The atand2() and atand2f() functions compute the principal value of the
arc tangent of y/x in the interval [-180,180] degrees. The sign of
atand2() and atand2f() is determined by the sign of y.
The sincos() and sincosf() functions compute the sine and cosine of x,
measured in radians.
The sincosd() and sincosdf() functions compute the sine and cosine of
x, measured in degrees.
Double_complex and float_complex data types can be used only by lan-
guages that support them.
The following table describes function behavior in response to excep-
tional arguments:
tab(@); lfHB lfHB lfHB l l l . _
Function@Exceptional Argument@Routine Behavior
_
sin(), sinf()@|x| = infinity@Invalid argument
sind(), sindf()@|x| = infinity@Invalid argument
sind(), sindf()@|x| < (180/pi) * min_float@Underflow
cos(), cosf()@|x| = infinity@Invalid argument
cosd(), cosdf()@|x| = infinity@Invalid argument
tan(), tanf()@|x| = infinity@Invalid argument
tand(), tandf()@|x| = infinity@Invalid argument
tand(), tandf()@|x| < (180/pi) * min_float@Underflow
tand(), tandf()@x = (2n+1) * 90@Overflow
cot(), cotf()@x = 0@Overflow
cotd(), cotdf()@|x| = multiples of 180 degrees@Overflow
asin(), asinf()@|x| > 1@Invalid argument
asind(), asindf()@|x| > 1@Invalid argument
acos(), acosf()@|x| > 1@Invalid argument
acosd(), acosdf()@|x| > 1@Invalid argument
atan2(), atan2f()@x = y = 0@Invalid argument
atan2(), atan2f()@|x| = |y| = infinity@Invalid argument
atand2(), atand2f()@x = y = 0@Invalid argument
atand2(), atand2f()@|x| = |y| = infinity@Invalid argument
sincos(), sincosf()@|x| = infinity@Invalid argument
sincosd(), sincosdf()@|x| = infinity@Invalid argument
_
The following table lists boundary values used by these functions:
tab(@); lfHB lfHB lfHB lfHB lfHB lfHB lfHB lfHB l l l l . _
Value@Data@Hexadecimal Value@Decimal Value Name@Type
_
(180/pi)@S_FLOAT@
[email protected] * min_float
@T_FLOAT@
[email protected]
_ delim off
sin(3)