function x = ball_positive_sample ( )

%*****************************************************************************80
%
%% ball_positive_sample() returns sample points in the unit positive ball.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    12 August 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Russell Cheng,
%    Random Variate Generation,
%    in Handbook of Simulation,
%    edited by Jerry Banks,
%    Wiley, 1998, pages 168.
%
%    Reuven Rubinstein,
%    Monte Carlo Optimization, Simulation, and Sensitivity
%    of Queueing Networks,
%    Wiley, 1986, page 232.
%
%  Output:
%
%    real X(3), the point.
%
  rng ( 'shuffle' );

  x = randn ( 3, 1 );
%
%  Normalize the vector.
%
  x = abs ( x ) / norm ( x );
%
%  Now compute a value to map the point ON the sphere INTO the sphere.
%
  r = rand ( );
 
  x = r ^ ( 1.0 / 3.0 ) * x;

  return
end
