function AP=affine_map(A,P)
[m,n]=size(A);
[mp,np]=size(P);
if(n~=mp)
    disp('dimensions do not match: affine_map')
    return
end
AP=zeros(size(P));    
dummy=A*P;
AP=[dummy; ones(1,np)];
