function animation3()
clear
n=5001; t= linspace(0, 12*pi, n);
x = cos(t);  y = sin(t); 

box = [ 0 1 1 0 0;
        0 0 1 1 0];
    
box = [box;  ones(1,length(box(1,:)))];
    
    star = [0 0 1]';
    
for i = 1:n
        pause(0.003)
        tt=t(i);
        
        offset = [.5*sin(tt) 0*cos(tt)]';
        H= homog(tt,offset);
               
         newbox = H*box;
         newstar   = H*star;
         
         plot(newbox(1,:), newbox(2,:), ...
              newstar(1),newstar(2), 'g*', ...
              x,y)
          axis('equal'); axis([-2 2 -2 2]); 
end % end for loop


end % end function animation


function H = homog(theta,disp)
R = [cos(theta) -sin(theta);
             sin(theta) cos(theta)];
 
H = [[R disp]; [0 0 1]];
end