function P = ConstructProjection2(plane)
  % -----------------------------------------------------------------------
  % ConstructProjection2 - Construct the projection matrix that projects
  %                        onto the given plane.
  %
  % Args: plane - 'xy', 'yz' or 'zx': the plane to project onto
  %
  % Rtns: P - the 4 x 4 matrix of the projection
  % -----------------------------------------------------------------------

  switch plane
  case {'xy', 'yx'} % project onto the xy plane
    P = [
      1  0  0  0
      0  1  0  0
      0  0  0  0
      0  0  0  1
    ];
  case {'yz', 'zy'} % project onto the yz plane
    P = [
      0  0  0  0
      0  1  0  0
      0  0  1  0
      0  0  0  1
    ];
  case {'zx', 'xz'} % project onto the zx plane
    P = [
      1  0  0  0
      0  0  0  0
      0  0  1  0
      0  0  0  1
    ];
  otherwise
    error('"%s" is not a valid plane', axis);
  end
end
