Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function varmaplot1(a,b,beta,dx,v)
- cla
- x = [0 (v/(0.5+v)*2*a+dx) (2*a+(v/(0.5+v)*2*a))];
- y = [a 2*a 3*a];
- S = [(x(3)+a+b) y(2)];
- P = [(S(1)-a*cos(beta)) (S(2)-a*sin(beta))];
- % Teikna stimpill
- plot([x(1) x(3)],[y(1) y(1)],'k') % BOTN
- hold on
- plot([x(1) x(3)],[y(3) y(3)],'k') % TOPPUR
- plot([x(1) x(1)],[y(1) y(3)],'k') % BAK
- plot([x(2) x(2)],[y(1) y(3)],'k','LineWidth',2)
- plot([x(2) P(1)],[y(2) P(2)],'r')
- plot([P(1) S(1)],[P(2) S(2)],'r')
- plot(P(1),P(2),'ko','LineWidth',2)
- plot(S(1),S(2),'ko','LineWidth',2)
- xlim([-x(3) 3*x(3)])
- ylim([-x(3) 3*x(3)])
- drawnow
- refresh
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement