function triangle_refine_quad_test ( )

%*****************************************************************************80
%
%% triangle_refine_quad_test() tests triangle_refine_quad().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_refine_quad_test():\n' );
  fprintf ( 1, '  Test triangle_refine_quad().\n' );

  t = [ 4.0, 1.0; 8.0, 3.0; 0.0, 9.0 ];
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Triangle vertices:\n' );
  disp ( t )

  fprintf ( 1, '\n' );
  fprintf ( 1, '   C  N  Estimate\n' );
  fprintf ( 1, '\n' );
  for c = 1 : 10
    triangle_quad = triangle_refine_quad ( c, t, @f );
    triangle_num = triangle_refine_num ( c );
    fprintf ( 1, '  %2d  %3d  %g\n', c, triangle_num, triangle_quad );
  end

  return
end
function value = f ( xy )

%*****************************************************************************80
%
%% f() is the integrand.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 March 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real xy(:,2): evaluation points.
%
%  Output:
%
%    real value(:): the integrand values.
%
  value = sum ( xy(:,1).^2 + xy(:,2).^2 );

  return
end

