sin15°用Python怎么表示?

如题所述

第1个回答  2022-04-24
Python的三角函数sin(),输入参数必须是弧度,所以要把角度变换为弧度
import math

# .... 输入度数到 degrees 变量....
# 例子里用 30度计算
degrees=30

radians = degrees * math.pi / 180.0
value = round( math.sin(radians), 4)

print(value)
第2个回答  2022-04-24
import math
pi=math.pi
value = round(math.sin(30/180*pi), 4)
print(value)
相似回答