Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- Vp=50;
- xs=0; ys=250;
- xc=230;
- x=xs;
- i=1; t=0; dt=0.01;
- while x<=xc
- y = ys/xc*sqrt(xc^2-x^2);
- gamma=atan(-ys/xc*(x/sqrt(xc^2-x^2)));
- x=x+Vp*cos(gamma)*dt;
- t=t+dt;
- i=i+1;
- Z(i,1)=t; Z(i,2)=x; Z(i,3)=y; Z(i,4)=gamma;
- end
- plot(Z(:,2),Z(:,3),'Green'); grid on; hold all;
- clear all
- Vp=50;
- xs=230; ys=0;
- xc=320;yc=0;
- x=xs; y=ys;
- a=ys/xs;
- b=ys-a*xs;
- c=yc/xc;
- d=yc-c*xc;
- gamma=atan(a);
- i=1; t=0; dt=0.01;
- Z(i,1)=t; Z(i,2)=x; Z(i,3)=y; Z(i,4)=gamma; Z(i,5)=b;
- while x<=xc
- a=ys/xs;
- b=ys-a*xs;
- gamma=atan(a);
- x=x+Vp*cos(gamma)*dt;
- y=a*x+b;
- t=t+dt;
- i=i+1;
- Z(i,1)=t; Z(i,2)=x; Z(i,3)=y; Z(i,4)=gamma; Z(i,5)=b;
- end
- plot(Z(:,2),Z(:,3),'Green');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement