在python中導入數學函數的方法
python中使用數學函數時需要先引入math模塊
1.math.radians()函數
math.sqrt()函數可以將角度轉弧度
用法:
import mathmath.radians(57.29578)>>>0.9948376736367679
import math
math.radians(57.29578)
>>>0.9948376736367679
2. math.pi函數
math.pi函數的功能是計算圓周率
import mathmath.pi>>>3.141592653589793
math.pi
>>>3.141592653589793