从弧度到度数的转换 [python 2]

conversion from radian to degree [python 2]

下面这段代码有什么问题

import math
n = input ()
l = int(round((n*180)/math.pi))
print l

回答错误。 如果 n = 0.707106781187,那么它给出 l = 41。它应该是 45。

我认为您混淆了学位和百分度。 45 弧度的角约等于 41 度,50 弧度的角正好等于 45 度。程序本身是正确的。输入的 45 度输入值应为 0.785398,即 pi 除以 4。

有关度数、弧度和梯度的更多信息,请参见此处: https://en.wikipedia.org/wiki/Gradian