I am new to physics stackexchange, but I have a question which I seem to have not been able to find an answer to.
I already know that the transformations from Boyer-Lindquist coordinates to Cartesian coordinates are:
$ x=\sqrt{r^2 + a^2}\sin\theta \cos\phi\ $
$ y=\sqrt{r^2 + a^2}\sin\theta \sin\phi $
$ z=r\cos\theta $
However, whenever I have seen this transformation stated, I have never seen the inverse. I believe that when $a=0$, the transformations reduce from oblate spheroidal coordinates back to spherical coordinates, where:
$x=r\sin\theta \cos\phi$
$y=r\sin\theta \sin\phi$
$z=r\cos\theta$
and,
$r=\sqrt{x^2 + y^2 + z^2}$
$\theta=\arccos(\frac{z}{r})$
$\phi=\arctan(\frac{y}{x})$ (considering quadrants)
So when $a\neq0$, how do we define $(r,\theta,\phi)$ from $(x,y,z)$ (as well as if $r$ the coordinate is the same as $r$ in the line element/metric)? I think I have understood the rest about the Kerr(-Newman) metric but the definition of Boyer-Lindquist coordinates from Cartesian coordinates is what puzzles me and I have not yet seen an answer. I am doing this in order to simulate test particles in a Kerr-Newman spacetime where $G, M, Q, c, K$ may not be $1$ using the first order equations of motion from Wikipedia. This may probably only be used in order to easily define initial conditions for the system before intergrating velocities to find the test particles' positions but, I would still like an answer just in case it becomes more important in the future.
Any help, resources or articles would be greatly appreciated as well any fundamental concepts I may not seem to have grasped yet (I won't mind if I have actually been doing everything incorrectly). Thank you very much for reading!
P.S. when defining this term is expressed: $\frac{x^2 + y^2}{r^2 + a^2} + \frac{z^2}{r^2}=1$, I found the relation between $r$ and $x,y,z,a$ to be:
$r=\frac{\sqrt{\sqrt{z^4 + 2y^2z^2 + 2x^2z^2 + 2a^2z^2 + y^4 + 2x^2y^2 - 2a^2y^2 + x^4 - 2a^2x^2 + a^4} + x^2 + y^2 + z^2 - a^2}}{\sqrt{2}}$ If this is correct, then that means that I have just incorrectly implemented these and I will try again, or $\theta$ and $\phi$ aren't the same as they are in spherical coordinates.