function uniform_on_ellipsoid_test ( )

%*****************************************************************************80
%
%% uniform_on_ellipsoid_test() tests uniform_on_ellipsoid().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2013
%
%  Author:
%
%    John Burkardt
%
  n = 200;
  d = 2;
  A = [ 3.0,  1.0; ...
        1.0,  2.0 ]';
  r = 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'uniform_on_ellipsoid_test():\n' );
  fprintf ( 1, '  uniform_on_ellipsoid() maps uniform\n' );
  fprintf ( 1, '  points onto 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:\n' );
  disp ( A )
  fprintf ( 1, '  Right hand side R = %g\n', r );

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

  return
end
