You are on page 1of 1

function [Hmax,Dmax,stock]=trajectoire2(v,theta)

theta=(theta.*pi)/180;
g=9.81;
stock=[ ];
Hmax=[];
Dmax=[];
c=1;
taille=0;
for ind=1:length(v)
for indic=1:length(theta)
hmax=(v(ind)*sin(theta(indic)))^2/2*g;
dmax=(2*sin(theta(indic))*cos(theta(indic))*v(ind)^2)/g;
tmax=(v(ind)*sin(theta(indic)))/g
l=1;
Hmax=[Hmax,hmax];
Dmax=[Dmax,dmax];
for x=0:0.1:dmax
stock(l,c)=((-10*x^2)/(2*v(ind)^2*cos(theta(indic))^2))
+x*tan(theta(indic));
l=l+1
taille=taille+1;

end
c=c+1;
end
end
for compt=1:length(taille)
hold on
plot(stock(1:taille(compt),compt)
end

You might also like