math.sin incorrect result

前端 未结 2 1786
南方客
南方客 2021-01-02 15:35
>>> import math
>>> math.sin(68)
-0.897927680689

But

sin(68) = 0.927 (3 decimal places)

Any ide

2条回答
  •  悲哀的现实
    2021-01-02 16:11

    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

提交回复
热议问题