Lets say two cannon is fired at different initial position, initial angle and initial speed.
let say initial speed,angle and position for
projectile 1= v0=18; theta=49 Degree; position={0,0}
projectile 2= v0=15; theta=56 Degree; position={95,100}
How to write a code that can simulate this event.
How to calculate these two projectiles distances as a function of time say from t=0
to t=10
seconds.
Between both fired canon ball what is their distances? at lets say t=7.9
seconds.
this is my code so far
x0 = 0; y0 = 0; g = -9.81;
vx0 := v0*Sin[theta]; vy0 := v0*Cos[theta];
x[t_] := x0 + v0*Cos[theta]*t;
y[t_] := y0 + v0*Sin[theta]*t + 0.5 g*t^2;
v0 = 18.0; theta = 49 Degree;
T = -2 (y0 + v0*Sin[theta])/g;
pp1 = ParametricPlot[{x[t], y[t]}, {t, 0, 1 T}, PlotRange -> All,
PlotStyle -> Blue];
v0 = 15.0; theta = 56 Degree;
T = -2 (y0 + v0*Sin[theta])/g;
pp2 = ParametricPlot[{x[t], y[t]}, {t, 0, 1 T}, PlotRange -> All,
PlotStyle -> Red];
Show[{pp1, pp2}]
All Help is Really Appreciated