%
% diamond.m
%

close all

A = [1 2;0 1];
B = A';
iA = inv(A);
iB = inv(B);

n = 4;

cnt = 0;
for i=-n/2:n/2,
    lag = n/2 - abs(i);
    for j=-lag:lag,
        cnt = cnt + 1;
        x(cnt) = i;
        y(cnt) = j;
        text(i,j,num2str(cnt))
        hold on
        
        Az = A*[i; j];
        iAz = iA*[i; j];
        text(Az(1)+8,Az(2),num2str(cnt))
        text(iAz(1)+8,iAz(2),num2str(cnt),'color','r')
        
        Bz = B*[i; j];
        iBz = iB*[i; j];
        text(Bz(1)+16,Bz(2),num2str(cnt))
        text(iBz(1)+16,iBz(2),num2str(cnt),'color','r')
    end
end

axis([-n/2 18 -n n])
axis off
axis equal
axis tight
print('-depsc2','diamond')


