function [ mu, var ] = annulus_distance_stats ( n, pc, r1, r2 )

%*****************************************************************************80
%
%% annulus_distance_stats() estimates annulus distance statistics.
%
%  Discussion:
%
%    A circular annulus with center PC, inner radius R1 and
%    outer radius R2, is the set of points P so that
%
%      R1^2 <= (P(1)-PC(1))^2 + (P(2)-PC(2))^2 <= R2^2
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 August 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of points to generate.
%
%    real PC(2), the center.
%
%    real R1, R2, the inner and outer radii.
%
%  Output:
%
%    real MU, VAR, the estimated mean and variance of the
%    distance between two random points on the ellipse.
%
  p = annulus_sample ( n, pc, r1, r2 );
  q = annulus_sample ( n, pc, r1, r2 );

  t = zeros ( n, 1 );
  for i = 1 : n
    t(i) = norm ( p(i,:) - q(i,:) );
  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
