Facebook
From hakerzy, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 186
  1. csv = csvread("punktman_n.csv");
  2.  
  3. stopnie = 90;
  4. radiany = stopnie * pi / 180;
  5. sx = 1;
  6. sy = 0.5;
  7. tx = 1;
  8. ty = -0.5;
  9.  
  10. MacierzObrot = [cos(radiany) -sin(radiany) 0; sin(radiany) cos(radiany) 0; 0 0 1];
  11. MacierzSkala = [sx 0 0; 0 sy 0; 0 0 1];
  12. MacierzPrzesun = [1 0 tx; 0 1 ty; 0 0 1];
  13. moc = MacierzPrzesun*MacierzSkala*MacierzObrot;
  14.  
  15. MatrixXY1 = [csv(:,1)';csv(:,2)';ones(1,length(csv(:,1)))];
  16.  
  17. for i = 1:3:length(MatrixXY1(1,:))
  18.    MatrixXY1(:,i:i+2) = moc * MatrixXY1(:,i:i+2);
  19. endfor
  20.  
  21. subplot (1, 2, 1)
  22. plot(csv(:,1),csv(:,2),'sk');
  23. subplot (1, 2, 2)
  24. plot(MatrixXY1(1,:),MatrixXY1(2,:),'sk');