Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

atan, atanf, atanl- Arc tangent

&pagelevel(4)&pagelevel

Definition  

#include <math.h>

double atan(double x);
float atanf(float x); (C11)
long double atanl(long double x); (C11)

These functions are the inverse function of the corresponding tan-functions.
They return the principal value (i.e. corresponding angle in radians) of the arc tangent of a floating-point number
 
x.

Return val.

arc tangent(x)  a floating-point number of type double from the interval [-pi/2, +pi/2].

Example

The following program calculates and prints the arc tangent of an input value:

#include <math.h>
#include <stdio.h>
int main(void)
{
  double x;
  printf("For which number do you want ATAN computed?: \n");
  if( scanf("%lf", &x) == 1)   /* Verifies the input of a number */
    printf("x = %g : atan(%g) = %g\n", x, x, atan(x));
  return 0;
}

See also

atan2, tan, sin, asin, cos, acos