sphere_quad


sphere_quad, a Fortran77 code which estimates the integral of a scalar function F(X,Y,Z) over the surface of the unit sphere in 3D.

The library includes one function, SPHERE01_QUAD_MC(), which estimates the integral using a Monte Carlo approach. It randomly samples points on the surface, and estimates the integral as the average of these values times the area of the surface.

The library includes three functions based on the idea of a latitudinal/longitudinal grid: SPHERE01_QUAD_LLC, SPHERE01_QUAD_LLV and SPHERE01_QUAD_LLM. The surface of the sphere is divided into rectangles whose sides are always lines of latitude or longitude. Each rectangle is then split diagonally into a pair of triangles (except for the degenerate rectangles that include the north or south pole as a vertex.)

The user controls the accuracy of the integral estimate by specifying a maximum side length H. The functions determine angular increments that guarantee the size restriction. Of course, this means that the restriction on latitude, enforced at the equator, will result in excessively small triangles away from the equator. That is a penalty of using this simple subdivision scheme.

The library includes three functions based on the idea of first subdividing the surface into 20 congruent spherical triangles, based on the projection of a regular icosahedron. The functions SPHERE01_QUAD_ICOS1C, SPHERE01_QUAD_ICOS1V and SPHERE01_QUAD_ICOS1M use this idea, along with subdivision.

The function SPHERE01_QUAD_ICOS2V is similar to SPHERE01_QUAD_ICOS1V but uses a more sophisticated algorithm to project points from the planar triangle to the unit sphere. However, the modifications seem to make little difference to the resulting integral estimate.

Licensing:

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

Languages:

sphere_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:

sphere_quad_test

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

sphere_cvt, a Fortran90 library which creates a mesh of well-separated points on a unit sphere using Centroidal Voronoi Tessellations.

SPHERE_DELAUNAY, a Fortran90 program which computes and plots the Delaunay triangulation of points on the unit sphere.

SPHERE_DESIGN_RULE, a Fortran90 library which returns point sets on the surface of the unit sphere, known as "designs", which can be useful for estimating integrals on the surface, among other uses.

SPHERE_EXACTNESS, a Fortran77 program which tests the monomial exactness of a quadrature rule over the surface of the unit sphere in 3D.

SPHERE_GRID, a Fortran77 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_INTEGRALS, a Fortran77 library which defines test functions for integration over the surface of the unit sphere in 3D.

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

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

SPHERE_TRIANGLE_QUAD, a Fortran90 library which estimates the integral of a function over a spherical triangle.

SPHERE_VORONOI, a Fortran90 program which computes the Voronoi diagram of points on a sphere.

STRIPACK, a Fortran90 library which computes the Voronoi diagram or Delaunay triangulation of pointsets on a sphere, by Robert Renka.

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

XYZ_DISPLAY, a MATLAB program which reads XYZ information defining points in 3D, and displays an image in the MATLAB graphics window.

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

Reference:

Source Code:


Last revised on 18 December 2023.