triangle_ncc_rule, a C code which defines Newton-Cotes closed (NCC) quadrature rules over the interior of a triangle in 2D.
Newton-Cotes rules have the characteristic that the abscissas are equally spaced. For a triangle, this refers to spacing in the unit reference triangle, or in the barycentric coordinate system. These rules may be mapped to an arbitrary triangle, and will still be valid.
The rules are said to be "closed" when they include points on the boundary of the triangle.
The use of equally spaced abscissas may be important for your application. That may how your data was collected, for instance. On the other hand, the use of equally spaced abscissas carries a few costs. In particular, for a given degree of polynomial accuracy, there will be rules that achieve this accuracy, but use fewer abscissas than Newton-Cotes. Moreover, the Newton-Cotes approach almost always results in negative weights for some abscissas. This is generally an undesirable feature, particularly when higher order quadrature rules are being used.
(Note that the first rule included in the set is not, strictly speaking, a Newton-Cotes closed rule; it's just the rule that uses a single point at the centroid. However, by including this rule as the first in the set, we have a rule with each polynomial degree of exactness from 0 to 8.)
The computer code and data files made available on this web page are distributed under the MIT license
triangle_ncc_rule is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version
ANNULUS_RULE, a C code which computes a quadrature rule for estimating integrals of a function over the interior of a circular annulus in 2D.
CUBE_FELIPPA_RULE, a C code which returns the points and weights of a Felippa quadrature rule over the interior of a cube in 3D.
PYRAMID_FELIPPA_RULE, a C code which returns Felippa's quadratures rules for approximating integrals over the interior of a pyramid in 3D.
SIMPLEX_GM_RULE, a C code which defines Grundmann-Moeller quadrature rules over the interior of a simplex in M dimensions.
SQUARE_FELIPPA_RULE, a C code which returns the points and weights of a Felippa quadrature rule over the interior of a square in 2D.
STROUD, a C code which defines quadrature rules for a variety of unusual areas, surfaces and volumes in 2D, 3D and N-dimensions.
TETRAHEDRON_FELIPPA_RULE, a C code which returns Felippa's quadratures rules for approximating integrals over the interior of a tetrahedron in 3D.
TETRAHEDRON_NCC_RULE, a C code which defines Newton-Cotes closed quadrature rules over the interior of a tetrahedron in 3D.
TRIANGLE_EXACTNESS, a C code which investigates the monomial exactness quadrature rule over the interior of a triangle in 2D.
TRIANGLE_FEKETE_RULE, a C code which defines Fekete rules for interpolation or quadrature over the interior of a triangle in 2D.
TRIANGLE_FELIPPA_RULE, a C code which returns Felippa's quadratures rules for approximating integrals over the interior of a triangle in 2D.
TRIANGLE_MONTE_CARLO, a C code which uses the Monte Carlo method to estimate integrals over the interior of a triangle in 2D.
TRIANGLE_NCO_RULE, a C code which defines Newton-Cotes open quadrature rules over the interior of a triangle in 2D.
TRIANGLE_SYMQ_RULE, a C code which returns efficient symmetric quadrature rules, with exactness up to total degree 50, over the interior of an arbitrary triangle in 2D, by Hong Xiao and Zydrunas Gimbutas.
WEDGE_FELIPPA_RULE, a C code which returns quadratures rules for approximating integrals over the interior of the unit wedge in 3D.