function [temp] = transformations(t,opt)
% [temp] = transformations(t,opt)
% called by iterate(t,opt)
% generates the frames in a movie

% options
% opt 1 -> rotate angle t
% opt 2 -> shift left t units
% opt 3 -> shift right t units
% opt 4 -> expand from origin to factor t

house = [1 0;3 0;3 2;3.2 2;2 3;.8 2;1 2;1 0]';
axis([-4,4,-4,4]);

if opt==1
    rotate=[cos(t) -sin(t);sin(t) cos(t)];
    data=(rotate*(house))'; 
    temp=line('xdata', data(:,1), 'ydata', data(:,2));
end

if opt == 2
    house(1,:)=house(1,:)-t;
    data=(house)'; 
    temp=line('xdata', data(:,1), 'ydata', data(:,2));
end

if opt == 3
    house(2,:)=house(2,:)-t;
    data=(house)'; 
    temp=line('xdata', data(:,1), 'ydata', data(:,2));
end

if opt == 4
    data=(t*eye(2)*house)'; 
    temp=line('xdata', data(:,1), 'ydata', data(:,2));
end