function w = r8vec_uniform_unit ( m )

%*****************************************************************************80
%
%% r8vec_uniform_unit() generates a random unit vector.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 October 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the dimension of the space.
%
%  Output:
%
%    real W(M), a random direction vector, with unit norm.
%
  w = randn ( m, 1 );
%
%  Compute the length of the vector.
%
  norm = sqrt ( sum ( w(1:m).^2 ) );
%
%  Normalize the vector.
%
  w(1:m) = w(1:m) / norm;

  return
end
