triangle_witherden_rule, a C++ code which returns a symmetric Witherden quadrature rule for the triangle, with exactness up to total degree 20.
The data is given for the following triangle:
(0,1) | \ | \ | \ | \ (0,0)--(1,0)
We suppose we are given a triangle T with vertices A, B, C. We call a rule with n points, returning barycentric coordinates a, b, c, and weights w. Then the integral I of f(x,y) over T is approximated by Q as follows:
(x,y) = a(1:n) * A + b(1:n) * B + c(1:n) * C Q = area(T) * sum ( 1 <= i <= n ) w(i) * f(x(i),y(i))
The information on this web page is distributed under the MIT license.
triangle_witherden_rule is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave versionand a Python version.
cpp_rule, a C++ code which computes a quadrature rule which estimates the integral of a function f(x), which might be defined over a one dimensional region (a line) or more complex shapes such as a circle, a triangle, a quadrilateral, a polygon, or a higher dimensional region, and which might include an associated weight function w(x).