C_C++/C_라이브러리_함수

(C언어) atan, atanl: 아크 탄젠트(arc tangent)값 계산

고니자니 2023. 1. 30. 10:02
반응형

#atan #atanl #아크탄젠트 #역탄젠트

 

#include <math.h>
double atan(double x);
long double atanl(long double x);

아크 탄젠트(arc tangent) 값을 구합니다.

-pt/2 ~ pi/2 사이의 값을 반환합니다.

 

#include <stdio.h>
#include <math.h>
int main()
{
	double x;
	for(x = -1; x <= 1;x += 0.1)
		printf("%.1f\t  %f\n", x, atan(x));
	return 0;
}

-1.0      -0.785398
-0.9      -0.732815
-0.8      -0.674741
-0.7      -0.610726
-0.6      -0.540420
-0.5      -0.463648
-0.4      -0.380506
-0.3      -0.291457
-0.2      -0.197396
-0.1      -0.099669
-0.0      -0.000000
0.1       0.099669
0.2       0.197396
0.3       0.291457
0.4       0.380506
0.5       0.463648
0.6       0.540420
0.7       0.610726
0.8       0.674741
0.9       0.732815
1.0       0.785398
728x90
반응형