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