SPHERE_GRID
Grids on a Sphere
SPHERE_GRID
is a MATLAB library which
constructs a variety of sets of points on the surface of the unit sphere.
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 GNU LGPL license.
Languages:
SPHERE_GRID is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
DISTANCE_TO_POSITION_SPHERE,
a MATLAB program which
estimates the positions of cities on a sphere (such as the earth)
based on a city-to-city distance table.
GEOMETRY,
a MATLAB library which
performs geometric calculations in 2, 3 and N dimensional space.
SPHERE_CVT,
a MATLAB library which
creates a mesh of well-separated points on a unit sphere using Centroidal Voronoi
Tessellations.
SPHERE_DELAUNAY,
a MATLAB program which
computes the Delaunay triangulation of points on a sphere.
SPHERE_GRID,
a dataset directory which
contains grids of points, lines, triangles or quadrilaterals on a sphere;
SPHERE_LEBEDEV_RULE,
a MATLAB library which
computes Lebedev quadrature rules for the unit sphere;
SPHERE_STEREOGRAPH,
a MATLAB library which
computes the stereographic mapping between points on the unit sphere
and points on the plane Z = 1.
SPHERE_VORONOI,
a MATLAB program which
computes the Voronoi diagram of points on a 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.
SPHERE_XYZF_DISPLAY,
a MATLAB program which
reads XYZF information defining points and faces,
and displays a unit sphere, the points, and the faces,
in the MATLAB graphics window. This can be used, for instance, to
display Voronoi diagrams or Delaunay triangulations on the unit sphere.
STRIPACK,
a FORTRAN90 library which
computes the Delaunay triangulation or Voronoi diagram of points on a unit sphere.
STROUD,
a MATLAB library which
defines quadrature rules for a variety of multidimensional regions.
Reference:
-
Edward Saff, Arno Kuijlaars,
Distributing Many Points on a Sphere,
The Mathematical Intelligencer,
Volume 19, Number 1, 1997, pages 5-11.
Source Code:
-
arc_cosine.m,
computes the arc cosine function, with argument truncation.
-
arc_sine.m,
computes the arc sine function, with argument truncation.
-
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_diff_norm.m,
returns the L2 norm of the difference of R8VEC's.
-
r8vec_norm.m,
returns the L2 norm of an R8VEC.
-
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.
-
timestamp.m,
prints the current YMDHMS date as a time stamp.
Examples and Tests:
-
sphere_grid_test.m,
calls all the tests;
-
sphere_grid_test_output.txt,
the output file.
-
sphere_grid_test01.m,
tests SPHERE_GRID_ICOS_NUM;
-
sphere_grid_test02.m,
tests SPHERE_GRIDPOINTS_ICOS1;
-
sphere_grid_test03.m,
tests SPHERE_GRIDPOINTS_ICOS2;
-
sphere_grid_test04.m,
tests SPHERE_LL_POINTS;
-
sphere_grid_test05.m,
tests SPHERE_SPIRALPOINTS;
-
sphere_grid_test06.m,
tests SPHERE_LL_LINES;
-
sphere_grid_test07.m,
tests SPHERE_GRID_Q4;
-
sphere_grid_test08.m,
tests SPHERE_GRID_T3;
-
sphere_grid_test09.m,
tests SPHERE_UNIT_SAMPLE.
-
sphere_grid_test10.m,
tests SPHERE_CUBED_POINTS.
-
sphere_grid_test11.m,
uses SPHERE_LL_POINTS and SPHERE_LL_LINES to draw a sphere with
a latitude/longitude grid on it.
-
sphere_grid_test12.m,
uses SPHERE_LL_POINTS and SPHERE_LLQ_LINES to draw a sphere with
a latitude/longitude quadrilateral grid on it.
-
sphere_grid_test13.m,
uses SPHERE_CUBED_POINTS and SPHERE_CUBED_LINES to draw a sphere with
a cubed sphere grid.
Data files and images of the sphere grids were created by the
example program.
You can go up one level to
the MATLAB source codes.
Last revised on 09 October 2012.