相关疑难解决方法(0)

不正常的数学结果不正确?

当我使用math.cos()和math.sin()函数时,我的python解释器表现得很时髦.例如,如果我在计算器上执行此操作:

cos(35)*15+9 = 21.28728066
sin(35)*15+9 = 17.60364655
Run Code Online (Sandbox Code Playgroud)

但是当我在python上执行此操作时(3.2和2.7)

>>> import math
>>> math.cos(35)*15+9
-4.5553830763726015

>>> import math
>>> math.sin(35)*15+9
2.577259957557734
Run Code Online (Sandbox Code Playgroud)

为什么会这样?

编辑:为了以防万一,你如何将Python中的Radian更改为度?

python math trigonometry

2
推荐指数
1
解决办法
2045
查看次数

标签 统计

math ×1

python ×1

trigonometry ×1