> Online tutorial : math.h in c
Showing posts with label math.h in c. Show all posts
Showing posts with label math.h in c. Show all posts

math.h in c

atan() in c

atan Arc cosine, arc sine, and arc tangent functions
Declaration:
Real:
double atan(double x);
double atan2(double y, double x);
Remarks:
atan and atanl calculate the arc tangent of the input value
atan2 and atan2l also calculate the arc tangent of the input value
Return Value:
atan and atanl return the arc tangent of the input value (in the range -pi/2 to pi/2)
atan2 and atan2l return the arc tangent of y/x (in the range -pi to pi).

Program



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

int main(void)
{
   double result;
   double x = 0.5;

   result = atan(x);
   printf("The arc tangent of %lf is %lf\n", x, result);
   return(0);
}