function disk_distance_histogram ( n )

%*****************************************************************************80
%
%% disk_distance_histogram() histograms disk distance statistics.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 September 2018
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of samples to use.
%
  t = zeros ( n, 1 );
  for i = 1 : n
    p = disk_unit_sample ( );
    q = disk_unit_sample ( );
    t(i) = norm ( p - q );
  end

  bins = 20;
  normal = 1.0;
  [ ncenter, tcenter ] = hist ( t, bins );
  normal = sum ( tcenter ) / 2.0;
  hist ( t, bins, normal );

  grid ( 'on' )
  xlabel ( '<-- Distance -->' )
  ylabel ( '<-- Frequency -->' )
  title ( 'Distance between a pair of random points in a unit disk' )

  return
end
