function line_distance_histogram ( n )

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

  bins = 20;
  normalization = bins;
% histogram ( t, bins, 'Binlimits', [0.0,1.0], 'Normalization', 'pdf' );
  hist ( t, bins, normalization );
  grid ( 'on' );
  xlabel ( '<-- Distance -->' );
  ylabel ( '<-- Frequency -->' );
  title ( 'Distance between random point pairs in a unit line segment' );

  return
end
