trig_sun(3M)

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

SYNOPSIS

cc [ flag ... ] file ... -lsunmath -lm [ library ... ]

#include <sunmath.h>

void sincos(double x, double *s, double *c);

double sind(double x);

double cosd(double x);

double tand(double x);

double asind(double x);

double acosd(double x);

double atand(double x);

double atan2d(double y, double x);

void sincosd(double x, double *s, double *c);

double sinpi(double x);

double cospi(double x);

double tanpi(double x);

double asinpi(double x);

double acospi(double x);

double atanpi(double x);

double atan2pi(double y, double x);

void sincospi(double x, double *s, double *c);

double sinp(double x);

double cosp(double x);

double tanp(double x);

double asinp(double x);

double acosp(double x);

double atanp(double x);

void sincosp(double x, double *s, double *c);

DESCRIPTION

sincos(x,s,c) allows simultaneous computation of *s:=sin(x) and *c:=cos(x).

sind(x), cosd(x), and tand(x) return trigonometric functions of degree arguments. sind(x):= sin(x*π/180). The corresponding inverse functions compute asind(x):= asin(x)*180/π. Similarly atan2d(y,x):= atan2(y,x)*180/π.

sinpi(x), cospi(x), and tanpi(x) avoid range-reduction issues because their definition sinpi(x):= sin(π*x) permits range reduction that is fast and exact for all x. The corresponding inverse functions compute asinpi(x):= asin(x)/π. Similarly atan2pi(y,x):= atan2(y,x)/π.

sinp(x), cosp(x), and tanp(x) use PI/2, the double precision approximation to π/2, in the argument reduction step to reduce arguments exceeding PI/4 in magnitude to the range -PI/4 to PI/4 . The argument reduction step is accomplished by the fmod function; thus it is much faster than using the true value of π. The relation between sinp and sin is sinp(x):= sin(x*π/PI). The corresponding inverse functions asinp(x):= asin(x)*PI/π. Since PI/π is close to 1, we simply return asin(x). The same applies to acosp(x) and atanp(x).

SEE ALSO
ieee_functions(3M), trig(3M).