|
sin(90) 라고 쓰신것 부터 잘못됐습니다.
씨언어에서 모든 삼각함수에 들어가는 각도값은 (도) 단위가 아니라
라디안 단위입니다.
sin(90)를 구하려면.. 라디안 단위로 바꿔서
sin( 3.14 / 180 * 90 ) 이렇게 넣어야합니다.
sin 에서 나온 결과값은 각도의 단위가 아닙니다. 그냥 sin 값이죠
변환할 의미가 없습니다
아래 sin()함수 도움말 참조하세요
-------------------------------------------------------------
Header File
math.h
Category
Math Routines
Prototype
double sin(double x);
long double sinl(long double x);
Description
Calculates sine.
sin computes the sine of the input value. Angles are specified in radians.
.각도 입력하는것이 라디안 단위라는겁니다
sinl is the long double version; it takes a long double argument and returns a long double result. Error handling for these functions can be modified through the functions _matherr and _matherrl.
Return Value
sin and sinl return the sine of the input value.
-------------------------------------------------------------
이성제 님이 쓰신 글 :
: Radian 에서 Degree 로 변환 할때여.
:
: double Set_Degree(double X) { return 180 / 3.141592653589793 * X; };
:
: 이게 식은 맞는듯 한데...
:
: 결과가 완전 다르네요. 뭔가 잘못됬나요? ㅠ.ㅠ
:
: Set_Degree( sin(90 )); 하면 1이 안나오네요 ㅠㅠㅠ
|