function polygon_distance_stats_test ( )

%*****************************************************************************80
%
%% polygon_distance_stats_test() tests polygon_distance_stats().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 June 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polygon_distance_stats_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test polygon_distance_stats().\n' );

  nv = 10;

  v = [ ...
    [0.0; 0.0], ...
    [0.5; 0.3], ...
    [1.0; 0.0], ...
    [0.7; 0.4], ...
    [1.0; 0.6], ...
    [0.6; 0.6], ...
    [0.5; 1.0], ...
    [0.4; 0.6], ...
    [0.0; 0.6], ...
    [0.3; 0.4] ]; 

  r8mat_transpose_print ( 2, nv, v, '  Polygonal vertices:' );

  n = 10000;
  [ d_mean, d_var, d_min, d_max ] = polygon_distance_stats ( n, nv, v );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  N    = %d\n', n );
  fprintf ( 1, '  Min  = %g\n', d_min );
  fprintf ( 1, '  Mean = %g\n', d_mean );
  fprintf ( 1, '  Max  = %g\n', d_max );
  fprintf ( 1, '  Var  = %g\n', d_var );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polygon_distance_stats_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
