function uniform_on_simplex_test ( )

%*****************************************************************************80
%
%% uniform_on_simplex_test() tests uniform_on_simplex().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 500;
  d = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_on_simplex_test():\n' );
  fprintf ( 1, '  uniform_on_simplex() returns uniform random\n' );
  fprintf ( 1, '  points on the surface of the unit simplex.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =    %12d\n', n );
  fprintf ( 1, '  Spatial dimension D =   %12d\n', d );

  p = uniform_on_simplex ( n, d );
%
%  Make a plot.
%
  clf ( );
  scatter3 ( p(:,1), p(:,2), p(:,3), 'b', 'filled' );
  grid ( 'on' );
  axis ( 'equal' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  zlabel ( '<--- Z --->' );
  title ( 'uniform\_on\_simplex() (3D)' );
  filename = 'uniform_on_simplex.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
