.\" @(#)trig_sun.3m 1.5 97/02/25 SMI; from UCB 4.3 BSD .TH trig_sun 3M "1 Sep 1993" .SH NAME trig_sun, sincos, sind, cosd, tand, asind, acosd, atand, atan2d, sincosd, sinp, cosp, tanp, asinp, acosp, atanp, sincosp, sinpi, cospi, tanpi, asinpi, acospi, atanpi, atan2pi, sincospi \- more trigonometric functions .SH SYNOPSIS .LP .B cc .RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." .B \-lsunmath -lm .RI "[ " "library" " \|.\|.\|. ]" .LP .B #include .LP .BI "void sincos(double " "x" , .BI "double *" "s" , .BI "double *" "c" ); .LP .BI "double sind(double " "x" ); .LP .BI "double cosd(double " "x" ); .LP .BI "double tand(double " "x" ); .LP .BI "double asind(double " "x" ); .LP .BI "double acosd(double " "x" ); .LP .BI "double atand(double " "x" ); .LP .BI "double atan2d(double " "y" , .BI "double " "x" ); .LP .BI "void sincosd(double " "x" , .BI "double *" "s" , .BI "double *" "c" ); .LP .BI "double sinpi(double " "x" ); .LP .BI "double cospi(double " "x" ); .LP .BI "double tanpi(double " "x" ); .LP .BI "double asinpi(double " "x" ); .LP .BI "double acospi(double " "x" ); .LP .BI "double atanpi(double " "x" ); .LP .BI "double atan2pi(double " "y" , .BI "double " "x" ); .LP .BI "void sincospi(double " "x" , .BI "double *" "s" , .BI "double *" "c" ); .LP .BI "double sinp(double " "x" ); .LP .BI "double cosp(double " "x" ); .LP .BI "double tanp(double " "x" ); .LP .BI "double asinp(double " "x" ); .LP .BI "double acosp(double " "x" ); .LP .BI "double atanp(double " "x" ); .LP .BI "void sincosp(double " "x" , .BI "double *" "s" , .BI "double *" "c" ); .SH DESCRIPTION .IX "sincos function" "" "\fLsincos\fP" .IX "mathematical functions" sincos "" \fLsincos\fP .IX "trigonometric functions" sincos "" \fLsincos\fP .IX "sind function" "" "\fLsind\fP \(em trigonometric sine degree" .IX "mathematical functions" sind "" \fLsind\fP .IX "trigonometric degree functions" sind "" \fLsind\fP .IX "cosd function" "" "\fLcosd\fP \(em trigonometric cosine degree" .IX "mathematical functions" cosd "" \fLcosd\fP .IX "trigonometric degree functions" cosd "" \fLcosd\fP .IX "tand function" "" "\fLtand\fP \(em trigonometric tangent degree" .IX "mathematical functions" tand "" \fLtand\fP .IX "trigonometric degree functions" tand "" \fLtand\fP .IX "asind function" "" "\fLasind\fP \(em trigonometric arcsine degree" .IX "mathematical functions" asind "" \fLasind\fP .IX "trigonometric degree functions" asind "" \fLasind\fP .IX "acosd function" "" "\fLacosd\fP \(em trigonometric arccosine degree" .IX "mathematical functions" acosd "" \fLacosd\fP .IX "trigonometric degree functions" acosd "" \fLacosd\fP .IX "atand function" "" "\fLatand\fP \(em trigonometric arctangent degree" .IX "mathematical functions" atand "" \fLatand\fP .IX "trigonometric degree functions" atand "" \fLatand\fP .IX "atan2d function" "" "\fLatan2d\fP \(em trigonometric arctangent degree" .IX "mathematical functions" atan2d "" \fLatan2d\fP .IX "trigonometric degree functions" atan2d "" \fLatan2d\fP .IX "sincosd function" "" "\fLsincosd\fP" .IX "mathematical functions" sincosd "" \fLsincosd\fP .IX "trigonometric degree functions" sincosd "" \fLsincosd\fP .IX "sinpi function" "" "\fLsinpi\fP" .IX "mathematical functions" sinpi "" \fLsinpi\fP .IX "trigonometric degree functions" sinpi "" \fLsinpi\fP .IX "cospi function" "" "\fLcospi\fP" .IX "mathematical functions" cospi "" \fLcospi\fP .IX "trigonometric degree functions" cospi "" \fLcospi\fP .IX "tanpi function" "" "\fLtanpi\fP" .IX "mathematical functions" tanpi "" \fLtanpi\fP .IX "trigonometric degree functions" tanpi "" \fLtanpi\fP .IX "asinpi function" "" "\fLasinpi\fP" .IX "mathematical functions" asinpi "" \fLasinpi\fP .IX "trigonometric degree functions" asinpi "" \fLasinpi\fP .IX "acospi function" "" "\fLacospi\fP" .IX "mathematical functions" acospi "" \fLacospi\fP .IX "trigonometric degree functions" acospi "" \fLacospi\fP .IX "atanpi function" "" "\fLatanpi\fP" .IX "mathematical functions" atanpi "" \fLatanpi\fP .IX "trigonometric degree functions" atanpi "" \fLatanpi\fP .IX "atan2pi function" "" "\fLatan2pi\fP" .IX "mathematical functions" atan2pi "" \fLatan2pi\fP .IX "trigonometric degree functions" atan2pi "" \fLatan2pi\fP .IX "sincospi function" "" "\fLsincospi\fP" .IX "mathematical functions" sincospi "" \fLsincospi\fP .IX "trigonometric degree functions" sincospi "" \fLsincospi\fP .IX "sinp function" "" "\fLsinp\fP \(em trigonometric sine" .IX "mathematical functions" sinp "" \fLsinp\fP .IX "trigonometric functions" sinp "" \fLsinp\fP .IX "cosp function" "" "\fLcosp\fP \(em trigonometric cosine" .IX "mathematical functions" cosp "" \fLcosp\fP .IX "trigonometric functions" cosp "" \fLcosp\fP .IX "tanp function" "" "\fLtanp\fP \(em trigonometric tangent" .IX "mathematical functions" tanp "" \fLtanp\fP .IX "trigonometric functions" tanp "" \fLtanp\fP .IX "asinp function" "" "\fLasinp\fP \(em trigonometric arcsine" .IX "mathematical functions" asinp "" \fLasinp\fP .IX "trigonometric functions" asinp "" \fLasinp\fP .IX "acosp function" "" "\fLacosp\fP \(em trigonometric arccosine" .IX "mathematical functions" acosp "" \fLacosp\fP .IX "trigonometric functions" acosp "" \fLacosp\fP .IX "atanp function" "" "\fLatanp\fP \(em trigonometric arctangent" .IX "mathematical functions" atanp "" \fLatanp\fP .IX "trigonometric functions" atanp "" \fLatanp\fP .IX "sincosp function" "" "\fLsincosp\fP" .IX "mathematical functions" sincosp "" \fLsincosp\fP .IX "trigonometric functions" sincosp "" \fLsincosp\fP .LP .BI sincos( x , s , c\fB) allows simultaneous computation of .BI * s :=sin( x ) and .BI * c :=cos( x ). .LP .BI sind( x ), .BI cosd( x ), and .BI tand( x ) return trigonometric functions of degree arguments. .BI sind( x ):= .BI sin( x * \(*p/180 ). The corresponding inverse functions compute .BI asind( x ):= .BI asin( x )* 180/\(*p. Similarly .BI atan2d( y , x ):= .BI atan2( y , x )* 180/\(*p. .PP .BI sinpi( x ), .BI cospi( x ), and .BI tanpi( x ) avoid range-reduction issues because their definition .BI sinpi( x ):= .BI sin( \(*p * x ) permits range reduction that is fast and exact for all .I x. The corresponding inverse functions compute .BI asinpi( x ):= .BI asin( x ) /\(*p . Similarly .BI atan2pi( y , x ):= .BI atan2( y , x ) /\(*p. .PP .BI sinp( x ), .BI cosp( x ), and .BI tanp( x ) use .IR PI/2 , the double precision approximation to \(*p/2, in the argument reduction step to reduce arguments exceeding .I PI/4 in magnitude to the range .I \-PI/4 to .I PI/4 . The argument reduction step is accomplished by the .B fmod function; thus it is much faster than using the true value of \(*p. The relation between .B sinp and .B sin is .BI sinp( x ):= .BI sin( x * \(*p/PI ). The corresponding inverse functions .BI asinp( x ):= .BI asin( x ) *PI/\(*p . Since .I PI/\(*p is close to 1, we simply return .BI asin( x ). The same applies to .BI acosp( x ) and .BI atanp( x ). .SH "SEE ALSO" .BR asin (3M), .BR acos (3M), .BR atan (3M), .BR atan2 (3M), .BR cos (3M), .BR sin (3M), .BR tan (3M).