math.degrees(x)

本页内容
上一节: Ref_math_cosh 下一节: Ref_math_dist

Python math.degrees() 方法

Python math 模块

Python math.degrees(x) 方法将角度 x 从弧度转换为度数。

PI (3.14..) 弧度等于 180 度,也就是说 1 弧度等于 57.2957795 度。

math.radians() 方法将度数值转换为弧度。

Python 版本: 2.3

语法

math.degrees() 方法语法如下:


示例

math.degrees(x)

参数说明:

  • x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。

返回值

返回一个浮点数,表示角度。

==

以下实例返回不同弧度转换为度数:


示例

# 导入 math 包

import math

# 输出弧度转换为度数

print (math.degrees(8.90))

print (math.degrees(-20))

print (math.degrees(1))

print (math.degrees(90))

输出结果:


示例

509.9324376664327
-1145.9155902616465
57.29577951308232
5156.620156177409

Python math 模块

上一节: Ref_math_cosh 下一节: Ref_math_dist
此页面最后编辑于2022年8月17日 (星期三) 21:51。