function quad = triangle_refine_quad ( c, t, f )

%*****************************************************************************80
%
%% triangle_refine_quad() estimates an integral over a refined triangle.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 March 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer C: the number of refinements.
%
%    real T(3,2): the triangle vertices.
%
%    value = f(xy): the function handle.
%
%  Output:
%
%    real QUAD: the estimate of the integral.
%
  centroids = triangle_refine_centroids ( c, t );
  n = triangle_refine_num ( c );
  area = triangle_area ( t );
  quad = f ( centroids ) * area / n;

  return
end

