function x = idempotent_random_eigen_right ( n, rank, key )

%*****************************************************************************80
%
%% idempotent_random_eigen_right() returns right eigenvectors of the idempotent_random matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 May 2020
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Alston Householder, John Carpenter,
%    The singular values of involutory and of idempotent matrices,
%    Numerische Mathematik,
%    Volume 5, 1963, pages 234-237.
%
%  Input:
%
%    integer N, the order of the matrix.
%
%    integer RANK, the rank of A.
%    0 <= RANK <= N.
%
%    integer KEY, a positive value that selects the data.
%
%  Output:
%
%    real X(N,N), the matrix.
%
  x = orthogonal_random_matrix ( n, key );

  x = x';

  return
end
