Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>atan() calculate arc tangent</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
atan()                   Calculate Arc Tangent

 #include <math.h>

 double     atan(x);                     arc tangent value (in radians)
 double     x;                           tangent value

    atan() returns the arc tangent of 'x' in radians.  The return value
    will be in the range -pi/2 to pi/2.  All values of 'x' are legal.

    Returns:    Arc tangent of 'x'.

      Notes:    atan() does not return any errors.

  -------------------------------- Example ---------------------------------

    The following statements print the arc tangent of -1.0.

         #include <math.h>        /* Required for function definition only */
         #include <stdio.h>       /* for printf() */

         main()
         {
             double arc_tan;

             arc_tan = atan(-1.0);   /* arc_tan = -pi/4 (-0.7853982) */
             printf("arc tangent of -1 is %.7f radians\n", arc_tan);
         }

See Also: atan2() tan() matherr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson