unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

TRIG(3M)                                                              TRIG(3M)



NAME
       sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions

SYNOPSIS
       #include <&lt;math.h>&gt;

       double sin(x)
       double x;

       double cos(x)
       double x;

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

       double tan(x)
       double x;

       double asin(x)
       double x;

       double acos(x)
       double x;

       double atan(x)
       double x;

       double atan2(y, x)
       double y, x;

       double sinpi(x)
       double x;

       double cospi(x)
       double x;

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

       double tanpi(x)
       double x;

       double asinpi(x)
       double x;

       double acospi(x)
       double x;

       double atanpi(x)
       double x;

       double atan2pi(y, x)
       double y, x;

DESCRIPTION
       sin(),  cos(),  sincos(),  and  tan() return trigonometric functions of
       radian arguments.  The values of trigonometric functions  of  arguments
       exceeding /4 in magnitude are affected by the precision of the approxi-
       mation to /2 used to reduce those arguments to the  range  -/4  to  /4.
       Argument  reduction  may occur in hardware or software; if in software,
       the variable fp_pi defined in <&lt;math.h>&gt; allows changing  that  precision
       at  run  time.   Trigonometric  argument  reduction is discussed in the
       Note: sincos(x,s,c) allows simultaneous computation of *s = sin(x)  and
       *c = cos(x).

       asin() returns the arc sin in the range -/2 to /2.

       acos() returns the arc cosine in the range 0 to .

       atan() returns the arc tangent of x in the range -/2 to /2.

       atan2(y,x)  and  hypot(x,y) (see hypot(3M)) convert rectangular coordi-
       nates (x,y) to polar (r,); atan2() 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 or +-, in conformance with 4.3BSD, as discussed in the

       sinpi(), cospi(), and  tanpi()  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)/.

DIAGNOSTICS
       These functions handle exceptional arguments in the spirit of ANSI/IEEE
       Std 754-1985.  sin(+-), cos(+-), tan(+-), or asin(x)  or  acos(x)  with
       |x|>1,  return NaN; sinpi(x) et. al. are similar.  In addition, asin(),
       acos(), and atan2() may also set errno and call matherr(3M).

SEE ALSO
       hypot(3M), matherr(3M)



                                 28 March 1988                        TRIG(3M)