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

 #include <math.h>

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

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

    Returns:    Arctangent of 'x'.

      Notes:    atan() does not return any errors.

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

    The following statements print the arctangent of -1.0.

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

           main()
           {
               double arc_tan;

               arc_tan = atan(-1.0);   /* arc_tan = -pi/4 (-0.7853982) */
               printf("arctangent 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