**triangle_integrals**,
a MATLAB code which
returns the exact value of the integral of a polynomial
over the interior of an arbitrary triangle in 2D.

The computer code and data files described and made available on this web page are distributed under the MIT license

**triangle_integrals** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.

ball_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit ball in 3d.

circle_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the surface of the unit circle in 2d.

cube_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit cube in 3d.

disk01_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit disk in 2d.

hexagon_integrals, a MATLAB code which returns the exact value of the integral of a monomial over the interior of a hexagon in 2d.

hyperball_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit hyperball in m dimensions.

hypercube_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit hypercube in m dimensions.

hypersphere_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the surface of the unit hypersphere in m dimensions.

line_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the length of the unit line in 1d.

polygon_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of a polygon in 2d.

pyramid_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit pyramid in 3d.

simplex_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit simplex in m dimensions.

sphere_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the surface of the unit sphere in 3d.

square_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit square in 2d.

tetrahedron_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit tetrahedron in 3d.

triangle_dunavant_rule, a MATLAB code which sets up a dunavant quadrature rule over the interior of a triangle in 2d.

triangle_fekete_rule, a MATLAB code which defines fekete rules for quadrature or interpolation over the interior of a triangle in 2d.

triangle_felippa_rule, a MATLAB code which returns felippa's quadratures rules for approximating integrals over the interior of a triangle in 2d.

triangle_lyness_rule, a MATLAB code which returns lyness-jespersen quadrature rules over the interior of a triangle in 2d.

triangle_monte_carlo, a MATLAB code which uses the monte carlo method to estimate the integral of a function over the interior of the unit triangle in 2d.

triangle_ncc_rule, a MATLAB code which defines newton-cotes closed quadrature rules over the interior of a triangle in 2d.

triangle_nco_rule, a MATLAB code which defines newton-cotes open quadrature rules on a triangle.

triangle_symq_rule, a MATLAB 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.

triangle_wandzura_rule, a MATLAB code which sets up a quadrature rule of exactness 5, 10, 15, 20, 25 or 30 over the interior of a triangle in 2d.

triangle01_integrals, a MATLAB code which determines the exact integral of a monomial over the unit triangle in 2d.

wedge_integrals, a MATLAB code which returns the exact value of the integral of any monomial over the interior of the unit wedge in 3d.

- i4_to_pascal.m, converts an I4 to a pair of indices in Pascal's triangle;
- i4_to_pascal_degree.m, converts an I4 to the degree (sum) of the corresponding pair of indices in Pascal's triangle;
- pascal_to_i4.m, converts a pair of indices in Pascal's triangle to a linear index;
- poly_power_linear.m, computes a power of a linear polynomial in X and Y.
- poly_power.m, computes a power of a polynomial in X and Y.
- poly_print.m, prints a polynomial in X and Y.
- poly_product.m, computes the product of two polynomials in X and Y.
- r8mat_print.m, prints an R8MAT;
- r8mat_print_some.m, prints some of an R8MAT;
- rs_to_xy_map.m, determines the map coefficients from the reference to physical triangle.
- triangle01_monomial_integral.m computes the integral of a monomial over the reference triangle.
- triangle01_poly_integral.m computes the integral of a polynomial over the reference triangle.
- triangle_area.m computes the area of a arbitary triangle.
- triangle_monomial_integral.m computes the integral of a monomial over an arbitrary triangle.
- triangle_poly_integral.m computes the integral of a polynomial over an arbitrary triangle.
- triangle_xy_integral.m computes the integral of xy over an arbitrary triangle.
- trinomial.m, computes a trinomial coefficient;
- xy_to_rs_map.m, determines the map coefficients from the physical to reference triangle.