**triangle_integrals**,
an Octave 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
an Octave version and
a Python version.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

tetrahedron_integrals, an Octave code which returns the exact value of the integral of any monomial over the interior of the unit tetrahedron 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.