math.sin incorrect result

丶灬走出姿态 提交于 2019-12-03 13:44:30
>>> import math
>>> print math.sin.__doc__
sin(x)

Return the sine of x (measured in radians).

math.sin expects its argument to be in radians, not degrees, so:

>>> import math
>>> print math.sin(math.radians(68))
0.927183854567

by default angle in Python is calculated in radians. So, you can try to multiply the angle ( degrees ) by 0.01745 - to convert it to degrees and input the values. print(math.sin(60*0.01745)) 0.8659266112878228

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!