0

How to fix the sin, cos, and tan functions in the math module in Python

I have been trying to get the sin,cos,tan functions to be working but it is not. It is giving me the wrong answer and i dont know how to fix it. For example, sin 30 is 0.5 normally but when i use the sin function it prints approximately -1 as the answer and i do not know what to do to fix it. Pls help me

5th Feb 2019, 7:40 PM
Sonicspeed^__^
Sonicspeed^__^ - avatar
1 Answer
+ 3
You need to convert degrees into radians for it to work. Use math.radians() and you will get what you are looking for. Ex. x = 30 x = math.radians(x) print(math.sin(x))
5th Feb 2019, 7:57 PM
Damiano
Damiano - avatar