screen 12 ?"Cannon shooting" ? x=2200 y=3500 pset(0,479):line-(500,479),5 pset(0,479):line-(0,160),14 color,,5 ?"Xtag=";x;"m" color,,14 ?"Ytag=";y;"m" color,,15 g=10 v=300 ?"Vshut=";v;"m/sec" a=g*x^2 b=-(2*x*v^2) c=(2*y*v^2)+g*x^2 rad=b^2-4*a*c '?rad qr=sqr(rad) '?qr tf1=(-b+qr)/(2*a) '?tf1 tf2=(-b-qr)/(2*a) '?tf2 f1=atn(tf1) pi=4*atn(1) fg1=f1*180/pi color 0,0,4 ?"angle1=";fg1;"degrees";" - red traectory" f2=atn(tf2) fg2=f2*180/pi color 0,0,2 ?"angle2=";fg2;"degrees";" - green traectory" window(0,0)-(5000,10000) dt=.01 tm=x/(v*cos(f1)) color,,4 ?"Tshoot1=";tm;"sec - shooting time at red traectory" for t=0 to tm step dt xt=v*cos(f1)*t yt=v*sin(f1)*t-(g*(t^2))/2 pset(xt,yt),4 next t tm=x/(v*cos(f2)) color,,2 ?"Tshoot2=";tm;"sec - shooting time at green traectory" for t=0 to tm step dt xt=v*cos(f2)*t yt=v*sin(f2)*t-(g*(t^2))/2 pset(xt,yt),2 next t pset(0,0),9 line-(x,y),9 pset(0,y):line-(x,y),5 pset(x,0):line-(x,y),14 color,,15 locate 10,1:?"-to quit" vvod: if inkey$=chr$(27) then stop else vvod stop