Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

matherr(3)



  trig(3)                             CLIX                             trig(3)



  NAME

    trig: sin, cos, tan, asin, acos, atan, atan2 - Returns trigonometric
    functions

  LIBRARY

    Standard Math Library (libm.a)

    Intergraph Math Library (libmath.a)

  SYNOPSIS

    #include <math.h>

    double sin(
      double x );

    double cos(
      double x );

    double tan(
      double x );

    double asin(
      double x );

    double acos(
      double x );

    double atan(
      double x );

    double atan2(
      double y, x );

  PARAMETERS

    x   A double.

    y   A double.

  DESCRIPTION

    The sin(), cos(), and tan() functions return, respectively, the sine,
    cosine, and tangent of the argument x, measured in radians.

    The asin() function returns the arcsine of x, in the range [-PI/2,PI/2].

    The acos() function returns the arccosine of x, in the range [0,PI].




  2/94 - Intergraph Corporation                                              1






  trig(3)                             CLIX                             trig(3)



    The atan() function returns the arctangent of x, in the range [-
    PI/2,PI/2].

    The atan2() function returns the arctangent of y / x, in the range [-
    PI,PI], using the signs of both arguments to determine the quadrant of the
    return value.

  EXAMPLES

    /* The following displays the arc sines of the values -1
    through +1 in increments of one tenth. */

    #include <math.h>
    main()
    {
         double val = -1.0;
         do {
              printf("arc sine of %f is %f\n", val, asin(val));
              val += 0.1;
         } while(val <= 1.0);
    }


  RETURN VALUES

    See DESCRIPTION.

  ERRORS

    The sin(), cos(), and tan() functions lose accuracy when their argument is
    far from 0.  For arguments sufficiently large, these functions return 0
    when there would otherwise be a complete loss of significance.  In this
    case a message indicating TLOSS error is displayed on stderr.  For less
    extreme arguments causing partial loss of significance, a PLOSS error is
    generated but no message is displayed.  In both cases, errno is set to
    ERANGE.

    If the magnitude of the argument of asin() or acos() is greater than one
    or if both arguments of atan2() are 0, a 0 is returned, and errno is set
    to EDOM.  Also, a message indicating a DOMAIN error is displayed on
    stderr.

    These error-handling procedures may be changed with the function
    matherr().

  RELATED INFORMATION

    Functions:  matherr(3)






  2                                              Intergraph Corporation - 2/94




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