function box_distance_histogram ( n, a, b, c )

%*****************************************************************************80
%
%% box_distance_histogram() histograms box distance statistics.
%
%  Discussion:
%
%    The box has sides of length a <= b <= c.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n: the number of pairs of sample points to use.
%
%    real a, b, c: the length of the sides.
%
  p = box_sample ( n, a, b, c );
  q = box_sample ( n, a, b, c );
  t = zeros ( n, 1 );
  for i = 1 : n
    t(i) = norm ( p(i,1:3) - q(i,1:3) );
  end

  bins = 20;
  dmin = 0.0;
  dmax = sqrt ( a^2 + b^2 + c^2 );
  histogram ( t, bins, 'Binlimits', [dmin,dmax], 'Normalization', 'pdf' );
  grid ( 'on' );
  xlabel ( '<-- Distance -->' );
  ylabel ( '<-- Frequency -->' );
  s = sprintf ( 'Distance two random points, box %g x %g', a, b );
  title ( s );

  return
end
