3d plot of Tridimensional parabolic motion
Show older comments
Hi, I am trying to get a 3D plot of a parabolic motion. I am trying to simulate debris from an airplane falling from a certain altitude. Obviously the parabolic motion and the absence of other forces is a simplification.
These are the initial conditions.
h_0=14325 m
V_0= 200*.3048 m/s
gamma = 0.78 rad
Obviously I want my object to reach the ground. I created the following code, but the plot is a little strange. I don't understand where or what is wrong
g=9.8;
z0= 14325;
x0=0;
y0=0;
V_0= 200*0.3048;
gamma=0.78;
V_0x=V_0*cos(gamma);
V_0y=V_0*cos(gamma);
V_0z=V_0*sin(gamma);
t = linspace(0,2*V_0*sin(gamma)/g);
x=x0+V_0x*t;
y=y0+V_0y*t-.5*g*t.^2;
z=z0+V_0z-.5*g*t.^2;
indices=z>=0;
x = x(indices);
y = y(indices);
z = z(indices);
plot3(x,y,z)
hold on
plot3(x0,y0,z0,'ro','MarkerSize',5)
xlabel('Posizione x (m)')
ylabel('Posizione y (m)')
zlabel('Posizione z (m)')
grid on
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
