Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- P = [1,0,-1,0,1;0,1,0,-1,0];
- plot(P(1,:),P(2,:),'b');
- axis([-5,5,-5,5],"square");
- alfa = pi/8;
- hold on;
- for i=1:3
- T = [cos(alfa) -sin(alfa); sin(alfa) cos(alfa)];
- P = T*P;
- plot(P(1,:),P(2,:),'b');
- endfor
- figure(2)
- axis([-3,3,-3,3],"square");
- P = [1,0,-1,0,1;0,1,0,-1,0];
- hold on;
- for i=1:50
- T = [cos(alfa) -sin(alfa); sin(alfa) cos(alfa)];
- P = T*P;
- P = P*0.9;
- fill(P(1,:),P(2,:),'r');
- endfor
- figure(3);
- P = [1,0,-1,0,1;0,1,0,-1,0];
- hold on;
- for i=1:50
- T = [cos(alfa) -sin(alfa); sin(alfa) cos(alfa)];
- P = T*P;
- P = P*0.9;
- P = P+[1;2];
- fill(P(1,:),P(2,:),'g');
- endfor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement