triangle_witherden_rule, a Python 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:

        | \ 
        |  \ 
        |   \ 
        |    \ 

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 computer code and data files made available on this web page are distributed under the MIT license


triangle_witherden_rule is available in a C version and a C++ version and a MATLAB version and an Octave versionand a Python version.

Related Data and Programs:

triangle_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit triangle in 2d.

triangle_monte_carlo, a Python code which uses the Monte Carlo method to estimate the integral of a function over the interior of the unit triangle in 2d.

triangle_twb_rule, a Python code which generates the points and weights of quadrature rules over the interior of a triangle in 2D, determined by Taylor, Wingate, and Bos.


  1. Freddie Witherden, Peter Vincent, On the identification of symmetric quadrature rules for finite element methods, Computers and Mathematics with Applications, Volume 69, pages 1232-1241, 2015.

Source Code:

Last revised on 23 April 2023.