function [ dmu, dvar ] = square_surface_distance_stats ( n )

%*****************************************************************************80
%
%% square_surface_distance_stats() estimates square surface distance statistics.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of sample points to use.
%
%  Output:
%
%    real DMU, DVAR, the estimated mean and variance of the
%    distance between two random points on the surface of the unit square.
%
  p1 = square_surface_sample ( n );
  p2 = square_surface_sample ( n );
  t = vecnorm ( ( p1 - p2 )' );

  dmu = mean ( t );
  dvar = var ( t );

  return
end
