Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ atan2(3c) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                 trig(3c)



        _________________________________________________________________
        sin, cos, tan, asin, acos, atan, atan2
        trigonometric functions
        _________________________________________________________________


        SYNTAX

        #include <math.h>

        double sin (x)
        double x;

        double cos (x)
        double x;

        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;


        DESCRIPTION

        Sin, cos and tan return,  respectively, the sine, cosine and
        tangent of their argument, x.  X is in radians.

        Asin returns the arcsine of x, in the range -π/2 to π/2.

        Acos returns the arccosine of x, in the range 0 to π.

        Atan returns the arctangent of x, in the range -π/2 to π/2.

        Atan2 returns the arctangent of y/x, in the range -π to π, using
        the signs of both arguments to determine the quadrant of the
        return value.


        DIAGNOSTICS

        Sin, cos, and tan lose accuracy when their argument is far from



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                 trig(3c)



        zero.  For arguments sufficiently large, these functions return
        zero when there would otherwise be a complete loss of
        significance.  In this case a message indicating TLOSS error is
        printed on the standard error output.  For less extreme arguments
        causing partial loss of significance, a PLOSS error is generated
        but no message is printed.  In both cases, errno is set to
        ERANGE.

        If the argument of asin or acos has a size greater than one, or
        if both arguments of atan2 are zero, zero is returned and errno
        is set to EDOM.  A message indicating DOMAIN error is printed on
        the standard error output.

        You can change these error-handling procedures with the function
        matherr(3M).


        SEE ALSO

        matherr(3M).


































        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026