function [xp,yp,zp] = mapc2p(xc,yc,zc)

global map_2d;

if (map_2d)
  [xp, yp] = mapc2p_2d(xc, yc);
  zp = 0*xp;
  return;
else
  r1 = 1;
  d = max(max(abs(xc),abs(yc)),abs(zc));
  r = max(sqrt(xc.^2 + yc.^2 + zc.^2), 1e-10);
  xp = d .* xc./r;
  yp = d .* yc./r;
  zp = d .* zc./r;
end;
