arc tangent function of one variable

You're viewing an older version of this page (#3229). View the current version.

View versions (4)

NAME

atan catan

INTERFACE

#include <math.h> double atan ( double x ) long atanl ( long double x ) float atanf ( float x )

#include <complex.h> complex atan(complex x) double complex catan(double complex x) float complex catanf(float complex x) long double complex catanl(long double complex x)

DESCRIPTION

The atan function computes the principal value of the arc tangent of x, returning a value in the range [-\pi/2, + \pi/2] The arc tangent is often also donated as tan^{-1}(x).

The complex inverse tangent is defined by

atan(x) = \frac{-1}{2} i \log \left( \frac{1+i x}{1-i x} \right)
(1)

Example 1

#include <stdio.h>
#include <math.h>

int main(void)
{
  double result, x=0.5;
  result = atan(x);
  printf("The arc sin of %lf is %lf\n", x, result);
}

SPECIAL VALUES

atan ( &plusmn;0 ) returns &plusmn;0. atan ( &plusmn;&infin; ) returns &plusmn;pi/2

SEE ALSO

acos , asin, atan2, cos, cosh, sin, sinh, tan, tanh

STANDARDS

The atan function conforms to ISO/IEC 9899:1999(E).

COMPATIBILITY

<table class="compat"> <tr><th></th><th>DOS</th><th>UNIX</th><th>Windows</th><th>ANSI C</th><th>C++ only</th></tr> <tr><td>atanl</td><td>&bull;</td><td></td><td>&bull;</td><td></td><td></td></tr> <tr><td>Real atan</td><td>&bull;</td><td>&bull;</td><td>&bull;</td><td>&bull;</td><td></td></tr> <tr><td>Complex atan</td><td>&bull;</td><td></td><td>&bull;</td><td></td><td>&bull;</td></tr> <tr><td>Complex catan</td><td></td><td>&bull;</td><td></td><td></td><td>&bull;</td></tr> </table>