sphere_grid
sphere_grid,
an Octave code which
constructs a variety of sets of points
over the surface of a 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.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the MIT license
Languages:
sphere_grid 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_grid_test
octave_grid,
an Octave code which
generates a regular grid of points inside a variety of regions
in one, two, three or many dimensions.
Reference:

Edward Saff, Arno Kuijlaars,
Distributing Many Points on a Sphere,
The Mathematical Intelligencer,
Volume 19, Number 1, 1997, pages 511.
Source Code:

atan4.m,
computes the inverse tangent of the ratio Y / X.

i4mat_transpose_print.m,
prints an I4MAT, transposed.

i4mat_transpose_print_some.m,
prints some of the transpose of an I4MAT.

icos_shape.m,
describes an icosahedron.

icos_num.m,
gives "sizes" for an icosahedron in 3D.

r8_uniform_01.m,
returns a unit pseudorandom R8.

r8mat_transpose_print.m,
prints a R8MAT, transposed.

r8mat_transpose_print_some.m,
prints some of an R8MAT, transposed.

r8vec_polarize.m,
decomposes an R8VEC into normal and parallel components.

r8vec_print.m,
prints an R8VEC.

sphere_cubed_ijk_to_xyz.m,
converts cubed sphere I,J,K coordinates to X,Y,Z coordinates.

sphere_cubed_line_num.m,
counts the lines in a cubed sphere grid.

sphere_cubed_lines.m,
computes the lines in a cubed sphere grid.

sphere_cubed_points.m,
computes the points in a cubed sphere grid.

sphere_cubed_points_face.m,
computes points on one face of a cubed sphere grid.

sphere_cubed_point_num.m,
counts the points in a cubed sphere grid.

sphere_distance_xyz.m,
computes great circle distances on a sphere.

sphere_grid_q4.m,
rectangular grid on a sphere.

sphere_grid_t3.m,
produces a triangle grid on a sphere.

sphere_icos_edge_num.m,
counts edges on an icosahedral grid on a sphere.

sphere_icos_face_num.m,
counts faces on an icosahedral grid on a sphere.

sphere_icos_point_num.m,
counts points on an icosahedral grid on a sphere.

sphere_icos1_points.m,
returns icosahedral grid points on a sphere.

sphere_icos2_points.m,
returns icosahedral grid points on a sphere.

sphere_line_project.m,
projects a line onto a sphere.

sphere_ll_lines.m,
produces lines on a latitude/longitude grid.

sphere_ll_line_num.m,
counts lines on a latitude/longitude grid.

sphere_ll_points.m,
produces points on a latitude/longitude grid.

sphere_ll_point_num.m,
counts points on a latitude/longitude grid.

sphere_llq_lines.m,
produces lines on a latitude/longitude quadrilateral grid.

sphere_llq_line_num.m,
counts lines on a latitude/longitude quadrilateral grid.

sphere_spiralpoints.m,
spiral points on a sphere.

sphere_unit_sample.m,
picks a random point on the unit sphere.
Last revised on 25 March 2019.