sphere_triangle_quad, a C++ code which estimates the integral of a scalar function F(X,Y,Z) over a spherical triangle on the unit sphere.

Three methods of estimation are very crude and cannot be improved:

• the centroid rule, based on a single function value.
• the vertex rule, which averages the vertex values.
• the midside rule, which averages the midside values.

One method of estimation uses random sampling, the Monte Carlo method, whose accuracy can be improved by increasing the number of sample points.

Another method is based on the centroid rule, but allows the user to decompose the original spherical triangle into collection of smaller triangles. The accuracy of the estimate should improve as the size of these triangles decreases.

### Languages:

sphere_triangle_quad is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.

### Related Data and Programs:

random_data, a C++ library which generates sample points for various probability distributions, spatial dimensions, and geometries;

SPHERE_EXACTNESS, a C++ program which tests the polynomial exactness of a quadrature rule for the unit sphere;

SPHERE_GRID, a C++ library which provides a number of ways of generating grids of points, or of points and lines, or of points and lines and faces, over the unit sphere.

SPHERE_LEBEDEV_RULE, a C++ library which computes Lebedev quadrature rules for the unit sphere;

SPHERE_MONTE_CARLO, a C++ library which applies a Monte Carlo method to estimate the integral of a function over the surface of the sphere in 3D;

SPHERE_QUAD, a C++ library which approximates an integral over the surface of the unit sphere by applying a triangulation to the surface;

SPHERE_TRIANGLE_MONTE_CARLO, a C++ library which applies a Monte Carlo method to estimate the integral of a function over a spherical triangle on the surface of the unit sphere in 3D;

STROUD, a C++ library which approximates the integral of a function on the surface or in the interior of a variety of geometric shapes.

XYZ_DISPLAY_OPENGL a C++ program which reads XYZ information defining points in 3D, and displays an image using OpenGL.

### Reference:

• Jacob Goodman, Joseph ORourke, editors,
Handbook of Discrete and Computational Geometry,
Second Edition,
CRC/Chapman and Hall, 2004,
ISBN: 1-58488-301-4,
LC: QA167.H36.

### Source Code:

Last revised on 08 November 2022.