function r8vec_covariance_test ( )

%*****************************************************************************80
%
%% R8VEC_COVARIANCE_TEST tests R8VEC_COVARIANCE.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    05 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_COVARIANCE_TEST:\n' );
  fprintf ( 1, '  R8VEC_COVARIANCE computes the covariance of two R8VEC''s.\n' );

  n = 2;
  v1 = [ 1.0; 0.0 ];
  r8vec_print ( n, v1, '  Vector V1:' );

  seed = 123456789;
  for i = 0 : 12
    angle = 2 * i * pi / 12;
    [ r, seed ] = r8_uniform_ab ( 0.0, 10.0, seed );
    v2 = r * [ cos(angle); sin(angle) ];
    r8vec_print ( n, v2, '  Vector V2:' );
    value = r8vec_covariance ( n, v1, v2 );
    fprintf ( 1, '  Covariance = %g\n', value );
  end

  return
end
