C examples for math.h:atan
function
<cmath> <ctgmath> <math.h>
Compute arc tangent
long double atanl (long double x); long double atan (long double x); double atan(double x); float atanf (float x); float atan (float x); double atan (T x);
Parameter | Description |
---|---|
x | Value whose arc tangent is computed. |
Principal arc tangent of x, in the interval [-pi/2,+pi/2] radians.
#include <stdio.h> #include <math.h> /* atan */ #define PI 3.14159265/*from w ww. ja v a2 s. c om*/ int main () { double param = 1.0; double result = atan (param) * 180 / PI; printf ("The arc tangent of %f is %f degrees\n", param, result ); return 0; }