Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.45 KB | None | 0 0
  1. x1=1; x2=-1;
  2. y1=-1; y2=0;
  3. y=((x-1)*(y2-y1)+y1*(x2-x1))/(x2-x1);
  4. subplot(1,2,1)
  5. plot(x,y,'LineWidth',2)
  6. hold on
  7. text(1,2,'m1');
  8. text(-1,0,'m2');
  9. line([-5 5],[0 0],'color','black');
  10. line([0 0],[-5 5],'color','black');
  11. text(-0.5,-0.5,'O')
  12. quiver(0,0,1,0,'k');
  13. quiver(0,0,0,1,'k');
  14. quiver(0,0,(x2-x1),(y2-y1),'LineWidth',3)
  15. quiver(1,4,(x2-x1),(y2-y1),'LineWidth',3)
  16. quiver(0,0,-(y2-y1),(x2-x1),'LineWidth',3)
  17. quiver(1,4,-(y2-y1),(x2-x1),'LineWidth',3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement