function ellipse_distance_test ( )

%*****************************************************************************80
%
%% ellipse_distance_test() tests ellipse_distance(_.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 March 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../ellipse_distance' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ellipse_distance_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s.\n', version ( ) );
  fprintf ( 1, '  Test ellipse_distance()\n' );

  n = 10000;
  a = 4.0;
  b = 2.5;
  [ mu, var ] = ellipse_distance_stats ( n, a, b );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using N = %d sample points,\n', n );
  fprintf ( 1, '  Estimated mean distance = %g\n', mu );
  fprintf ( 1, '  Estimated variance      = %g\n', var );

  n = 10000;
  a = 4.0;
  b = 2.5;
  ellipse_distance_histogram ( n, a, b );
  filename = 'ellipse_distance_histogram.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );
  pause ( 5 );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ellipse_distance_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../ellipse_distance' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

