The stereographic projection is a function that maps the n-dimensional sphere from the South pole (0,...,-1) to the tangent plane of the sphere at the north pole (0,...,+1).

stereographic(p)

stereographic_inv(q)

Arguments

p

point on the n-spere ; can also be a set of points, each point represented as a column of a matrix.

q

point on the tangent plane at the north pole (last coordinate = 1); can also be a set of such points.

Details

The stereographic projection is a smooth function from \(S^n - (0,\dots,-1)\) to the tangent hyperplane at the north pole. The south pole is mapped to infinity, that is why one speaks of \(S^n\) as a 'one-point compactification' of \(R^{n-1}\).

All mapped points will have a last coordinate 1.0 (lying on the tangent plane.) Points mapped by 'stereographic_inv' are assumed to have a last coordinate 1.0 (this will not be checked), otherwise the result will be different from what is expected – though the result is still correct in itself.

All points are column vectors: stereographic will transform a row vector to column; stereographic_inv will return a single vector as column.

Value

Returns a point (or a set of point) of (n-1) dimensions on the tangent plane resp. an n-dimensional point on the n-sphere, i.e., sum(x^2) = 1.

References

See the "Stereographic projection" article on Wikipedia.

Author

Original MATLAB code by J.Burkardt under LGPL license; rewritten in R by Hans W Borchers.

Note

To map a region around the south pole, a similar function would be possible. Instead it is simpler to change the sign of the last coordinate.

Examples