Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. figure
  2. line([10;0],[0;10])
  3. disp('enter the value of triangle');
  4. x1=input('x1=');
  5. y1=input('y1=');
  6. x2=input('x2=');
  7. y2=input('y2=');
  8. x3=input('x3=');
  9. y3=input('y3=');
  10. hold on
  11. line([x1;x2],[y1;y2]);
  12. line([x1;x3],[y1;y3]);
  13. line([x3;x2],[y3;y2]);
  14. hold off
  15. disp('enter the value of theta');
  16. th=input('theta is=');
  17. T=[1 0 0 ;0 1 0;0 -10 1];
  18. R=[cosd(th) sind(th) 0; -sind(th) cosd(th) 0; 0 0 1];
  19. RF=[1 0 0; 0 -1 0; 0 0 1];
  20. Rin=[cosd(-th) sind(-th) 0; -sind(-th) cosd(-th) 0; 0 0 1];
  21. Tin=[1 0 0;0 1 0;0 10 1 ];
  22. CT=T*R*RF*Rin*Tin;
  23. Tri=[x1 y1 1; x2 y2 1; x3 y3 1];
  24. Tri=Tri*CT;
  25. disp(Tri);
  26. p=Tri(1,1);
  27. q=Tri(1,2);
  28. s=Tri(2,1);
  29. t=Tri(2,2);
  30. u=Tri(3,1);
  31. v=Tri(3,2);
  32. %figure
  33. hold on
  34. axis([-80,25,-20,80]);
  35.  
  36. line([10,-80],[-20,10]);
  37. line([p;s],[q;t]);
  38. line([p;u],[q;v]);
  39. line([u;s],[v;t]);
  40. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement