0

can anyone help me ot of this c code

sin of 90 degrees is not coming 1 and the value of the angles are not correct https://code.sololearn.com/c0CaVfAWFVbR/?ref=app

11th Jan 2018, 6:02 PM
Rahul guha
Rahul guha - avatar
4 odpowiedzi
+ 3
Math trig functions nearly always use radians. There are 2π rads in a circle. The conversion from degrees to radians is: degrees * M_PI / 180 // To get π constant #define _USE_MATH_DEFINES // before #include math... Your angle should also probably be a floating type, so it can be used to store the converted value.
11th Jan 2018, 6:23 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Cause these functions take a radian angle , you must transform from degree to radian Radian = Degree * ( PI / 180 )
11th Jan 2018, 6:18 PM
Ahmed Salem
0
thanks man
11th Jan 2018, 6:21 PM
Rahul guha
Rahul guha - avatar
0
thanks man
11th Jan 2018, 6:24 PM
Rahul guha
Rahul guha - avatar