MATLAB: How to rotate, scale and transform x y z coordination.

project

I want to do coding for following equations. How i do it using mat lab. Please help me.

Best Answer

clc; clear all ;
% square coordinates
Sx = [0 1 1 0 0] ;
Sy = [0 0 1 1 0] ;
S = [Sx' Sy'] ;
% Rotation
th = linspace(0,2*pi) ;
for i = 1:length(th)
R = [cos(th(i)) sin(th(i)) ; -sin(th(i)) cos(th(i))] ;
Sr = S*R ;
plot(S(:,1),S(:,2),'b')
hold on
plot(Sr(:,1),Sr(:,2),'r')
hold off
drawnow
pause(0.1)
end