function circle_distance_histogram ( n )

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

  bins = 20;
  histogram ( t, bins, 'Binlimits', [0.0,2.0], 'Normalization', 'pdf' );
  grid on
  xlabel ( '<-- Distance -->' )
  ylabel ( '<-- Frequency -->' )
  title ( 'Distance between a pair of random points on a unit circle' )

  return
end
