function uniform_in_ellipsoid_test ( )

%*****************************************************************************80
%
%% uniform_in_ellipsoid_test() tests uniform_in_ellipsoid().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 1000;
  d = 2;
  A = [ 3.0, 1.0; ...
        1.0, 2.0 ]';
  r = 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_in_ellipsoid_test()\n' );
  fprintf ( 1, '  uniform_in_ellipsoid() maps uniform \n' );
  fprintf ( 1, '  points into an ellipsoid x''Ax=r^2.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =    %12d\n', n );
  fprintf ( 1, '  Spatial dimension D =   %12d\n', d );
  fprintf ( 1, '  Ellipsoid matrix A:\n' );
  disp ( A )
  fprintf ( 1, '  Ellipsoid right hand side r = %g\n', r );

  p = uniform_in_ellipsoid ( n, d, A, r )
%
%  Plot the data.
%
  clf ( );
  plot ( p(:,1), p(:,2), 'b.', 'markersize', 5 );
  axis ( 'equal' );
  grid ( 'on' );
  xlabel ( '<-- X -->' );
  ylabel ( '<-- Y -->' );
  title ( 'uniform\_in\_ellipsoid() 2D' );
  filename = 'uniform_in_ellipsoid.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
