※ 绘制炸弹轨迹 IV——更简单地绘制一条轨迹
作者:互联网
import numpy as np
import matplotlib.pyplot as plt
h, v0, g = 3000, 200, 9.8
n = 30
tmax=(2*h/g)**0.5
########## Begin ##########
t=np.linspace(0,tmax,30)
xt=v0*t
yt=h-0.5*g*t**2
########## End ##########
plt.plot(xt,yt,'r-')
plt.grid('on')
plt.axis([0, 5000, 0, h])
plt.show()
plt.savefig( 'src/step4/student/pic.png' )
plt.close()
标签:轨迹,0.5,IV,v0,plt,##########,import,绘制,xt 来源: https://blog.csdn.net/qq_42833469/article/details/121330032