# SPHERE_STEREOGRAPH Stereographic Mapping Between Sphere and Plane

SPHERE_STEREOGRAPH is a FORTRAN90 program which implements the standard stereographic mapping between the unit sphere and the plane Z=1, as well as a generalization of this mapping.

The stereographic projection preserves angles, and is a conformal mapping. This implies, for instance, that the Delaunay triangulation of a sphere maps to a corresponding Delaunay triangulation of the plane.

Circles on the sphere that do not pass through the focus will be projected to circles on the plane. Circles on the sphere that do pass through the focus will be projected to straight lines on the plane.

### The Standard Projection

We start with a sphere of radius 1 and center C = (0,0,0).

A plane is chosen, tangent to the sphere, at a point of tangency T which we take to be the "north pole", T = (0,0,1). We use a focus point F, which we take to be the "south pole", (0,0,-1)

For any point P on the sphere, the stereographic projection Q of the point is defined by drawing the line from F through P, and computing Q as the intersection of this line with the plane.

For any point Q on the plane, the stereographic inverse projection P of the point is defined by drawing the line from F through Q, and computing P as the intersection of this line with the sphere.

The function sphere_stereograph carries out the standard projection, and sphere_stereograph_inverse does the inverse.

### Projection with arbitrary center and focus

One way to generalize the projection is to allow the center C and focus point F to be arbitrary. If we assume the point of tangency is antipodal to F then T = 2*C-F. Once these points are defined, the stereographic projection relative to F, C, and T can be set up in the same way as before.

The function sphere_stereograph2 carries out the generalized projection, and sphere_stereograph2_inverse does the inverse.

### Licensing:

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

### Languages:

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

GEOMETRY, a FORTRAN90 library which performs geometric calculations in 2, 3 and M dimensional space.

SPHERE_CVT, a FORTRAN90 library which creates a mesh of well-separated points on a unit sphere using a Centroidal Voronoi Tessellation (CVT).

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.

SPHERE_GRID, a FORTRAN90 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 FORTRAN90 library which computes Lebedev quadrature rules for the unit sphere;

SPHERE_STEREOGRAPH_DISPLAY, a MATLAB library which computes and displays the results of several stereographic projections between a sphere and a plane.

SPHERE_VORONOI, a FORTRAN90 program which computes and plots the Voronoi diagram of points on the unit sphere.

STRIPACK, a FORTRAN90 library which computes the Delaunay triangulation or Voronoi diagram of points on a unit sphere, by Robert Renka.

STRIPACK_DELAUNAY, a FORTRAN90 program which reads a set of points on the unit sphere, computes the Delaunay triangulation, and writes it to a file.

### Reference:

1. C F Marcus,
The stereographic projection in vector notation,
Mathematics Magazine,
Volume 39, Number 2, March 1966, pages 100-102.

### List of Routines:

• PLANE_NORMAL_BASIS_3D finds two perpendicular vectors in a plane in 3D.
• R8_UNIFORM_01 returns a unit pseudorandom R8.
• R8MAT_NORM_FRO_AFFINE returns the Frobenius norm of an R8MAT difference.
• R8MAT_NORMAL_01 returns a unit pseudonormal R8MAT.
• R8MAT_UNIFORM_01 fills an R8MAT with unit pseudorandom numbers.
• R8VEC_ANY_NORMAL returns some normal vector to V1.
• R8VEC_CROSS_PRODUCT_3D computes the cross product of two R8VEC's in 3D.
• R8VEC_NORM returns the L2 norm of an R8VEC.
• R8VEC_NORM_AFFINE returns the affine norm of an R8VEC.
• R8VEC_NORMAL_01 returns a unit pseudonormal R8VEC.
• R8VEC_TRANSPOSE_PRINT prints an R8VEC "transposed".
• R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
• SPHERE_STEREOGRAPH computes the stereographic image of points on a sphere.
• SPHERE_STEREOGRAPH_INVERSE computes stereographic preimages of points.
• SPHERE_STEREOGRAPH2 computes the stereographic image of points on a sphere.
• SPHERE_STEREOGRAPH2_INVERSE computes stereographic preimages of points.
• TIMESTAMP prints the current YMDHMS date as a time stamp.
• UNIFORM_ON_SPHERE01_MAP maps uniform points onto the unit sphere.

You can go up one level to the FORTRAN90 source codes.

Last revised on 26 September 2012.