H=[-2 -2 0 2 2 1 0 0 1 1 -2
    0  2 3 2 0 0 0 1 1 0  0];
x=H(1,:)';y=H(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('House - Henry is at point marked x')
box off
pause
axis([-10 10 -10 10]);
axis('square');
a1=[ 1 0 
     0 1];
a1h=a1*H;
x=a1h(1,:)';y=a1h(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('House - Henry is at point marked x')
box off
print figa1;
pause
%
a2=[ 2 1 
     1 1];     % transition S' to S
a2i=inv(a2);     % transition S to S'
a2h=a2i*H;
x=a2h(1,:)';y=a2h(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('House in new basis (rose coloured glasses) - Henry is still at point marked x')
box off
print figa2;             %  house in new basis
pause
%
a3=[ -2  6
     -3 7 ];   % operator L - earthquake
A=a3;
a3h=a3*H;
x=a3h(1,:)';y=a3h(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('House after earthquake operator - Henry is (holding on) at point marked x')
box off
print figa3;              % house after earthquake
pause
%
a4h=a2i*a3h;           %  earthquake house in new basis
x=a4h(1,:)';y=a4h(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('House after earthquake operator (in rose coloured glasses) - Henry is  at point marked x')
box off
print figa4           %  earthquake house in new basis
pause
%
%
a5=[ 1 0 
     0 4];     % diagonalization of earthquake operator
a5h=a5*a2h;     % action of earthquake on house in new basis
x=a5h(1,:)';y=a5h(2,:)';plot(x,y,'o',x,y,'-',x(4),y(4),'xr');
xlabel('x_1 axis')
ylabel('x_2 axis')
title('action of earthquake on house in new basis, matrix B')
box off
print figa5;             %  house in new basis
