Function name : atan
Header file : <math.h>
Function prototype : double atan(double x);
Function : Find the number of radians whose tangent value is x
Parameters : double x tangent value, expressed in radians, the interval is (-π/2, π/2)
Return value : The degree of the angle whose tangent is x.
Note : atan() knows the tangent value y of an angle and finds the radian value x of the angle. Since the law of tangent could have two angles, but it only returns one, because the value range of atan is from -90 to 90, that is, it only handles one or four quadrants, so atan2() is generally used.
Program example : Find the number of radians whose tangent value is x, convert the result into an angle, and output the result
#include<math.h>#include<stdio.h>#definePI3.14159265intmain(void){doubleresult;doublex=1;result=atan(x)*180/PI;printf(Thearctangentof%lfis%lfn,x ,result);return(0);}
Running results:
Thearctangentof1.000000is45.000000