Python/ref math radians
来自菜鸟教程
<languages />
Python math.radians()方法
例
将不同的度数转换为弧度:
# Import math Library
import math
# Convert different degrees
into radians
print(math.radians(180))
print(math.radians(100.03))
print(math.radians(-20))
定义和用法
The
math.radians()
方法将度值转换为弧度。
Tip:
也可以看看
math.degrees()
将弧度的角度转换为度
句法
math.radians(x)
参数值
| 参数 | 描述 |
|---|---|
| x | 需要。要转换为弧度的度值。如果参数不是数字,则返回TypeError |
技术细节
| 返回值: | A
|
| Python版本: | 2.0 |