function [ mu, var ] = circle_positive_distance_stats ( n )

%*****************************************************************************80
%
%% circle_positive_distance_stats estimates positive circle distance statistics.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 August 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n: the number of sample points to use.
%
%  Output:
%
%    real mu, var: the estimated mean and variance of the
%    distance between two random points on the unit circle.
%
  t = zeros ( n, 1 );
  for i = 1 : n
    p = circle_positive_sample ( );
    q = circle_positive_sample ( );
    t(i) = norm ( p - q );
  end

  mu = sum ( t(1:n) ) / n;
  if ( 1 < n )
    var = sum ( ( t(1:n) - mu ) .^ 2 ) / ( n - 1 );
  else
    var = 0.0;
  end

  return
end
