function sphere_positive_distance_histogram ( n )

%*****************************************************************************80
%
%% sphere_positive_distance_histogram() histograms unit positive sphere distance statistics.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 August 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of samples to use.
%
  t = zeros ( n, 1 );
  for i = 1 : n
    p = sphere_positive_sample ( );
    q = sphere_positive_sample ( );
    t(i) = norm ( p - q );
  end

  bins = 20;
  histogram_pdf ( t, bins );
  grid ( 'on' );
  xlabel ( '<-- Distance -->' );
  ylabel ( '<-- Frequency -->' );
  title ( 'Distance between a pair of random points on a unit positive sphere' );

  return
end
