Python math.degrees() 方法
示例
將角度從弧度轉換為度
# 匯入 math 庫
import math
# 將弧度轉換為度
print (math.degrees(8.90))
print (math.degrees(-20))
print (math.degrees(1))
print (math.degrees(90))
自己動手試一試 »
定義和用法
mmath.degrees()
方法將角度從弧度轉換為度。
提示:PI (3.14..) 弧度等於 180 度,這意味著 1 弧度等於 57.2957795 度。
提示:另請參閱 math.radians()
以將度值轉換為弧度。
語法
math.degrees(x)
引數值
引數 | 描述 |
---|---|
x | 必需。要轉換為度的弧度值。如果引數不是數字,則返回 TypeError |
技術詳情
返回值 | 一個 float 值,表示以度為單位的值 |
---|---|
Python 版本 | 2.3 |