English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The atan() function calculates the arctangent of the parameter.
double atan(double x);
The atan() function takes a single double x as a parameter and returns the value in radians.
The type of the value returned by atan() is double.
To better understand atan():
[Mathematics] tan-1x = atan(x) [In C programming]
It is<math.h>Defined in the header file.
The library function atan() takes any value from negative to positive.
#include <stdio.h> #include <math.h> #define PI 3.141592654 int main() { double num = 1.0; double result; result = atan(num); printf("tan(%.2f) The arctangent is = %.2f "radians", num, result); //Convert radians to degrees result = (result * 180)} / PI; printf("\ntan(%2f) The arctangent is = %.2f "degree", num, result); return 0; }
Output Result
cos(1The arctangent of (0.00) is = 0.79 radians cos(1The arctangent of (0.00) is = 45 degree