Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- figure
- line([10;0],[0;10])
- disp('enter the value of triangle');
- x1=input('x1=');
- y1=input('y1=');
- x2=input('x2=');
- y2=input('y2=');
- x3=input('x3=');
- y3=input('y3=');
- hold on
- line([x1;x2],[y1;y2]);
- line([x1;x3],[y1;y3]);
- line([x3;x2],[y3;y2]);
- hold off
- disp('enter the value of theta');
- th=input('theta is=');
- T=[1 0 0 ;0 1 0;0 -10 1];
- R=[cosd(th) sind(th) 0; -sind(th) cosd(th) 0; 0 0 1];
- RF=[1 0 0; 0 -1 0; 0 0 1];
- Rin=[cosd(-th) sind(-th) 0; -sind(-th) cosd(-th) 0; 0 0 1];
- Tin=[1 0 0;0 1 0;0 10 1 ];
- CT=T*R*RF*Rin*Tin;
- Tri=[x1 y1 1; x2 y2 1; x3 y3 1];
- Tri=Tri*CT;
- disp(Tri);
- p=Tri(1,1);
- q=Tri(1,2);
- s=Tri(2,1);
- t=Tri(2,2);
- u=Tri(3,1);
- v=Tri(3,2);
- %figure
- hold on
- axis([-80,25,-20,80]);
- line([10,-80],[-20,10]);
- line([p;s],[q;t]);
- line([p;u],[q;v]);
- line([u;s],[v;t]);
- hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement