finding intercept point in the plot
Show older comments
close all
theta = 50;
v0=200;
slope= 0.1;
vx=v0*cosd(theta); %horizontal component of velocity vector
vy=v0*sind(theta); %vertical component of velocity vector
g=9.807;
tf=2*vy/g; %total flight time
t=linspace(0,tf,150);
for r=1:length(t)
x(r)=vx*t(r); %horizontal postion
A(r)=vy*t(r)-0.5*g*t(r)^2; %vertical postion of particle
R(r)=x(r)*slope; %vertical postion of terrain
end
figure(1)
plot(x,A,'b')
hold on
plot(x,R,'m')
title('Altitude VS Range')
xlabel('Range')
ylabel('Altitude')
legend({'Range','Line of Terrain'},'Location','southwest')
grid on
hold on
Accepted Answer
More Answers (2)
FRANCISCO CORTEZ
on 12 Apr 2021
0 votes
Image Analyst
on 22 May 2022
0 votes
See attached demo that computes just about everything you could ever want to know about a projectile.
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!