Greetings All
I have some test matlab code which can scale and do rotation but the translation (tl value) doesn't seem to be working. I expected the entire object to be moved over x=2 and y=0 but it doesn't move any ideas?
clf; clear all
rp=[0 4 2 -1 0; 0 1 -4 -3 0;0 0 0 0 0] %x-y values
scalenum=2 %scale factor
tx=2;ty=0; %translate values
%
for theta=0:45:90
tl=[1 0 tx; 0 1 ty;0 0 1] %translation
rot=[cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0;0 0 1];
%rotation
scale=[scalenum 0 0;0 scalenum 0;0 0 1] %scale
rt=tl*rp %new translation
r=rot*rp %new rotation of points
rs=scale*r %new scale with rotation
hold off
plot(rt(1,:),rt(2,:))
axis([-8 8 -8 8])
grid on
pause(.5)
end;