function animation2()
clear

n=501; t= linspace(0, 12*pi, n);

x = cos(t);  y = sin(t);
 


box = [ 0 1 1 0 0;
        0 0 1 1 0];
    
    star = [0 0]'
    
for i = 1:n
        pause(0.01)
        tt=t(i);
        R = [cos(tt) -sin(tt);
             sin(tt) cos(tt)];
         newbox = R*box;
         
         
         offset = [sin(tt) cos(tt)]';
         %offsetmat= offset*ones(1,5);
         offsetmat= repmat(offset,1,5);
         
         newbox = newbox + offsetmat;
         
         star = star + offset;
         
         plot(newbox(1,:), newbox(2,:), ...
              star(1),star(2), 'g*', ...
              x,y)
          axis('equal'); axis([-2 2 -2 2]); 
end % end for loop


end % end function animation