gpt4 book ai didi

python - 结果不正确的异常数学?

转载 作者:行者123 更新时间:2023-11-28 19:58:31 25 4
gpt4 key购买 nike

<分区>

当我使用 math.cos() 和 math.sin() 函数时,我的 python 解释器表现得很奇怪。例如,如果我在我的计算器上这样做:

cos(35)*15+9 = 21.28728066
sin(35)*15+9 = 17.60364655

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

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

>>> import math
>>> math.sin(35)*15+9
2.577259957557734

为什么会这样?

编辑:如何将 Python 中的弧度更改为度数,以防万一?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com