stereographic.RdThe 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)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.
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.
See the "Stereographic projection" article on Wikipedia.
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.