SPHERE_GRID is a FORTRAN77 library which constructs a grid of points over the surface of the unit sphere in 3D.
A grid on a sphere may mean a set of points, or a set of points and lines that connect them, or a set of points, lines that connect them, and the faces that are bounded by those lines.
A grid may be desired which simply organizes areas. In that case, something like the latitude and longitude lines on a globe may be sufficient, even though "evenly spaced" latitude and longitude lines result in grid cells that are close to rectangular near the equator, but become more asymmetric near the poles.
A grid may also be desired for sampling, that is, for choosing a set of points that are well spread across the sphere. A simple Monte Carlo approach can be used, although this means that the data is only well spread out in the long view; there may be local clusters and gaps.
Other grids are generated by drawing a spiral on the surface of the sphere, and choosing points at regular spacings along that line, or by projecting an icosahedron onto the surface of the sphere, which divides the surface into 20 congruent spherical triangles, and then dealing with the simpler issue of choosing points from the triangles.
The test program uses GNUPLOT to make images of some of the grids.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
SPHERE_GRID is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.
CUBE_GRID, a FORTRAN77 library which computes a grid of points over the interior of a cube in 3D.
DISK_GRID, a FORTRAN77 library which computes a grid of points over the interior of a disk in 2D.
GNUPLOT, FORTRAN77 programs which illustrate how a program can write data and command files so that gnuplot can create plots of the program results.
HYPERCUBE_GRID, a FORTRAN77 library which computes a grid of points over the interior of a hypercube in M dimensions.
LINE_GRID, a FORTRAN77 library which computes a grid of points over the interior of a line segment in 1D.
PYRAMID_GRID, a FORTRAN77 library which computes a grid of points over the interior of the unit pyramid in 3D;
SIMPLEX_GRID, a FORTRAN77 library which generates a regular grid of points over the interior of an arbitrary simplex in M dimensions.
SPHERE_CVT, a FORTRAN90 library which creates a mesh of well-separated points using Centroidal Voronoi Tessellations over the surface of the unit sphere in 3D.
SPHERE_DELAUNAY, a FORTRAN90 program which computes and plots the Delaunay triangulation of points over the surface of the unit sphere in 3D.
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 dataset directory which contains grids of points, lines, triangles or quadrilaterals on a 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_QUAD, a FORTRAN77 library which approximates an integral over the surface of the unit sphere by applying a triangulation to the surface;
SPHERE_VORONOI, a FORTRAN90 program which computes and plots the Voronoi diagram of points on the unit sphere.
SPHERE_XYZ_DISPLAY, a MATLAB program which reads XYZ information defining points in 3D, and displays a unit sphere and the points in the MATLAB graphics window.
SPHERE_XYZ_DISPLAY_OPENGL, a C++ program which reads XYZ information defining points in 3D, and displays a unit sphere and the points, using OpenGL.
SQUARE_GRID, a FORTRAN77 library which computes a grid of points over the interior of a square in 2D.
STRIPACK, a FORTRAN90 library which computes the Delaunay triangulation or Voronoi diagram of points on a unit sphere.
STRIPACK_INTERACTIVE, a FORTRAN90 program which reads a set of points on the unit sphere, computes the Delaunay triangulation, and writes it to a file.
STROUD, a FORTRAN77 library which defines quadrature rules for a variety of multidimensional regions.
TETRAHEDRON_GRID, a FORTRAN77 library which computes a grid of points over the interior of a tetrahedron in 3D.
WEDGE_GRID, a FORTRAN77 library which computes a grid of points over the interior of the unit wedge in 3D.
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.
To see the XYZ data files and images of the sphere grids created by this example program, go to the SPHERE_GRID dataset directory.
You can go up one level to the FORTRAN77 source codes.