function uniform_in_tetrahedron_test ( )

%*****************************************************************************80
%
%% uniform_in_tetrahedron_test() tests uniform_in_tetrahedron().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 1000;

  v = [ ...
    1.0,  2.0,  3.0; ...
    4.0,  1.0,  2.0; ...
    2.0,  4.0,  4.0; ...
    3.0,  2.0,  5.0  ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_in_tetrahedron_test():\n' );
  fprintf ( 1, '  uniform_in_tetrahedron() returns uniform\n' );
  fprintf ( 1, '  points in a tetrahedron.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =          %12d\n', n );
  fprintf ( 1, '  Vertices:\n' );
  disp ( v )

  p = uniform_in_tetrahedron ( n, v );
%
%  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\_in\_tetrahedron()' );
  filename = 'uniform_in_tetrahedron.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
