function pn = n3(p)
%
% n3: normalize vectors so third element is 1
% On input:
%     p: 3D vector
% On output:
%     pn: vector with hird element 1
% Call:
%     pn = n3(p)
%

[m,n] = size(p);
pn = p;
for i1 = 1:n
  pn(:,i1) = pn(:,i1)/pn(3,i1);
end
