Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = [2,3,4 ; 3,3,4 ; 4,4,4 ; 5,4,4 ; 5,4,5 ; 4,4,5 ; 3,3,5 ; 2,3,5 ; 2,3,4];
- hold on
- xj = [X ones(9,1)];
- S = [sum(X(:,1))/9, sum(X(:,2))/9, sum(X(:,3))/9];
- W = [1 0 0 0; 0 1 0 0; 0 0 1 0; -S(1) -S(2) -S(3) 1];
- RX = [1 0 0 0; 0 0 1 0; 0 -1 0 0; 0 0 0 1];
- RY = [1 0 0 0; 0 1 0 0; 0 0 d 0; 0 0 0 1];
- for theta = 30:30:360
- rad = (pi * theta)/180;
- WZ = [cos(rad) sin(rad) 0 0; -sin(rad) cos(rad) 0 0; 0 0 1 0; 0 0 0 1];
- R = xj * W;
- R = R * RX;
- R = R * RY;
- R = R * WZ;
- R = R * inv(RY);
- R = R * inv(RX);
- R = R * inv(W);
- plot3(R(:,1), R(:,2), R(:,3));
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement