function [P] = calc_projection_mat(A1, lowdim); 

len = round(size(A1,2)/lowdim);
dist1 = 0.0;
imdim = size(A1,1);
P = zeros([imdim imdim*len]);
for i=1:len,
  A11= A1(:,((i-1)*lowdim+1):(i*lowdim));
  P(:,((i-1)*imdim+1):(i*imdim)) =  A11 * ((A11'*A11)^(-1))*A11';
  %end
end
return;
% keyboard;
    






