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.
%

%
%  Get values from a standard uniform distribution.
%
  w = rand ( m, 1 );
%
%  Compute the length of the vector.
%
  w_norm = norm ( w );
%
%  Normalize the vector.
%
  w = w / w_norm;

  return
end
