function disk_distance_test ( )

%*****************************************************************************80
%
%% DISK_DISTANCE_TEST tests the DISK_DISTANCE library.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    05 January 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../disk_distance');

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'DISK_DISTANCE_TEST:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test DISK_DISTANCE.\n' );

  n = 10000;
  [ mu, var ] = disk_distance_stats ( n );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using N = %d sample points,\n', n );
  fprintf ( 1, '  Estimated mean distance = %g\n', mu );
  fprintf ( 1, '  Exact mean distance     = %g\n', 128 / ( 45 * pi ) );
  fprintf ( 1, '  Estimated variance      = %g\n', var );
  fprintf ( 1, '  Exact variance          = %g\n', (2025*pi^2 - 128^2) / ( 45 * pi )^2 );

  n = 10000;
  disk_distance_histogram ( n );
  filename = 'disk_distance_histogram.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );

  disk_distance_pdf ( );
  filename = 'disk_distance_pdf.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );

  clf
  hold on
  n = 10000;
  disk_distance_histogram ( n );
  disk_distance_pdf ( );
  hold off
  filename = 'disk_distance_compare.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'DISK_DISTANCE_TEST:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../disk_distance' );

  return
end
