import numpy as np
import matplotlib.pyplot as plt
def calBombTrace(a, v0):
g,n = 9.8,30
tmax = (2v0np.sin(a))/g
t = np.linspace(0, tmax, n)
xt = v0tnp.cos(a)
yt = v0tnp.sin(a)-1/2gt**2
return xt, yt
A = [np.angle(30),np.angle(45),np.angle(60),np.angle(75)]
V0 = [50]
for a in A:
for v0 in V0:
xt,yt = calBombTrace(a, v0)
plt.plot(xt,yt,'r-')
plt.grid('on')
plt.axis([0, 260, 0, 120])
plt.show()