Inverse of Torus parametrization any tips on finding the inverse of the following map:

$$(\theta,\phi)\mapsto ((2+\cos\theta)\cos(\phi),(2+\cos\theta)\sin(\phi),\sin\theta)$$

From doing it with cartesian :

One of the maps is:
I get $\phi^{\pm}(x_1,x_2,x_3)=(x_1,x_2)$ and 

$$(\phi^{\pm})^{-1}(x_1,x_2) = \left(x_1,x_2,\pm\sqrt{1-\left(\sqrt{x_1^2+x_2^2}-2\right)^2}\right)$$

I will add more as I go.

thanks
This might help

ParametricTorus[u_, v_, a_, 
   b_] := {(a Cos[u] + b) Cos[v], (a Cos[u] + b) Sin[v], a Sin[u]};

InverseParametricTorus[x_, y_, z_, a_, b_] := 
  With[{v = Pi/2 - ArcTan[y, x], v2 = ArcTan[y, x] + 2 Pi}, 
   With[{u = Pi/2 - ArcTan[z, (x/Cos[v] - b)]},
    {UnitStep[u]u + (1 - UnitStep[u])(u + 2 Pi), 
     UnitStep[v]v + (1 - UnitStep[v])(v + 2 Pi)}]];
This might help

ParametricTorus[u_, v_, a_, 
   b_] := {(a Cos[u] + b) Cos[v], (a Cos[u] + b) Sin[v], a Sin[u]};

InverseParametricTorus[x_, y_, z_, a_, b_] := 
  With[{v = Pi/2 - ArcTan[y, x], v2 = ArcTan[y, x] + 2 Pi}, 
   With[{u = Pi/2 - ArcTan[z, (x/Cos[v] - b)]},
    {UnitStep[u]u + (1 - UnitStep[u])(u + 2 Pi), 
     UnitStep[v]v + (1 - UnitStep[v])(v + 2 Pi)}]];