Reversing of sphere mapping function.

126 Views Asked by At

I have a function which maps a 3d unit vector $(x,y,z)$ to a 2d vector $(u,v)$ of the form:

\begin{align} u &= \frac{ x }{ 2\sqrt{x^2 + y^2 + (1+z)^2 }} + \frac12 \\ v &= \frac{ y }{ 2\sqrt{x^2 + y^2 + (1+z)^2} } + \frac12 \end{align}

There is an implicit 3rd function of $x^2+y^2+z^2=1$ due to the unit length requirement, of course. Also there is a singularity at $(0,0,-1)$, but for all other $(x,y,z)$ there is a one-to-one mapping between both spaces.

All I want to do is the reverse this function to compute $(x,y,z)$ from a given $(u,v)$ vector. Unfortunately I haven't succeeded doing it so far.

Can anybody help me out with that? Thank you.