per*_*012 1 python math physics trigonometry
在python数学中,im试图计算出对象的高度,而我需要平方平方来做。方程是速度^ * sin ^(角度)/ 2 *重力。
v = float(input('start vlocity m/s: '))
a = float(input('start angle : '))
equ = ((v**2) * math.sin**2(math.radians(a)) / 2 * 9.81
print(str(equ) + ' M')
Run Code Online (Sandbox Code Playgroud)
sin ^ 2(x)在数学上与(sin(x))^ 2相同,因此您可以编写
equ = ((v**2) * math.pow(math.sin(math.radians(a)), 2) / 2 * 9.81
Run Code Online (Sandbox Code Playgroud)
要么
equ = ((v**2) * math.sin(math.radians(a))**2 / 2 * 9.81
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8073 次 |
| 最近记录: |