function uniform_in_ellipse_test ( )

%*****************************************************************************80
%
%% uniform_in_ellipse_test() tests uniform_in_ellipse().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 April 2022
%
%  Author:
%
%    John Burkardt
%
  n = 400;
  A = [ 4.0, 1.0; ...
        1.0, 0.5 ];
  r = 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_in_ellipse_test():\n' );
  fprintf ( 1, '  uniform_in_ellipse() returns uniform random points\n' );
  fprintf ( 1, '  from inside an ellipse x''Ax=r^2.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points N =          %12d\n', n );
  fprintf ( 1, '  R =                           %12g\n', r );
  fprintf ( 1, '  Matrix A:\n' );
  disp ( A )

  p = uniform_in_ellipse ( n, A, r );
%
%  Make a plot.
%
  clf ( );
  plot ( p(:,1), p(:,2), 'b.' );
  grid ( 'on' );
  axis ( 'equal' );
  xlabel ( '<--- X --->' );
  ylabel ( '<--- Y --->' );
  title ( 'uniform\_in\_ellipse()' );
  filename = 'uniform_in_ellipse.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s".\n', filename );

  return
end
