SPHERE_STEREOGRAPH Stereographic Mapping Between Sphere and Plane

SPHERE_STEREOGRAPH is a C 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

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.

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 C library which performs geometric calculations in 2, 3 and M dimensional space.

SPHERE_GRID, a C 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_STEREOGRAPH_DISPLAY, a MATLAB library which computes and displays the results of several stereographic projections between a sphere and a plane.

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_ABS returns the absolute value of an R8.
• R8MAT_UNIFORM_01_NEW returns a unit pseudorandom R8MAT.
• R8VEC_ANY_NORMAL returns some normal vector to V1.
• R8VEC_COPY copies an R8VEC.
• 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 L2 norm of an R8VEC.
• R8VEC_NORMAL_01 samples the standard normal probability distribution.
• R8VEC_TRANSPOSE_PRINT prints a vector on one line.
• R8VEC_UNIFORM_01 fills a double precision vector with pseudorandom values.
• R8VEC_UNIFORM_01_NEW returns a new unit pseudorandom R8VEC.
• R8VEC_ZERO zeroes an 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 C source codes.

Last revised on 11 December 2013.