Given either geocentric latitude, longitude, and radius or geodetic latitude, longitude, and altitude, the computation of Earth-centered, Earth-fixed cartesian coordinates is fairly simple. For geocentric coordinates $R,\theta,\lambda$, one uses
$$
\begin{aligned}
R\ &\text{is the radial distance from the center of the Earth} \\
\theta\ &\text{is the geocentric latitude} \\
\lambda\ &\text{is the longitude} \\ \\
x &= R \cos\theta \cos\lambda \\
y &= R \cos\theta \sin\lambda \\
z &= R \sin\theta
\end{aligned}
$$
It's a bit more complex with geodetic coordinates $h, \phi, \lambda$, but still straightforward (equation 1):
$$
\begin{aligned}
h\ &\text{is the altitude above some reference ellipsoid} \\
\phi\ &\text{is the geodetic latitude} \\
\lambda\ &\text{is the longitude} \\
a\ &\text{is the equatorial radius of that reference ellipsoid} \\
e\ &\text{is the eccentricity of that reference ellipsoid} \\ \\
N\ &\text{is the radius of curvature of the reference ellipsoid at the subsatellite point:} \\
N &= \frac{a}{1-e^2\sin^2\phi} \\ \\
x &= (N+h) \cos\phi \cos\lambda \\
y &= (N+h) \cos\phi \sin\lambda \\
z &= (N(1-e^2)+h) \sin\phi
\end{aligned}
$$
What about the reverse problem, computing geocentric or geodetic coordinates given Earth-centered, Earth-fixed cartesian coordinates? Geocentric is easy:
$$\begin{aligned}
r^2 &= x^2 + y^2 \\
R^2 &= r^2 + z^2 \\
\tan \theta &= \frac z r \\
\tan \lambda &= \frac y x
\end{aligned}
$$
Geodetic coordinates for points known to be on the reference ellipsoid is also easy:
$$\begin{aligned}
r^2 &= x^2 + y^2 \\
h &= 0 \\
\tan \phi &= \frac z{r(1-e^2)} \\
\tan \lambda &= \frac y x
\end{aligned}
$$
But what about points that are not on the reference ellipsoid? This involves solving equation (1) for $h$, $\phi$, and $\lambda$ given $x$, $y$, and $z$. This is a transcendental hot mess. A large number of papers have been published on how to accomplish this, all involving either iteration or approximation, which are the only choices when faced with a transcendental hot mess. A small sampling of the many papers published on this topic:
K. M. Borkowski, “Accurate algorithms to transform geocentric to geodetic coordinates,” Bulletin Géodésique, 63.1 50–56 (1989).
T. Fukushima, “Fast transform from geocentric to geodetic coordinates,” Journal of Geodesy 73.11 603-610 (1999).
M. Ligas and P. Banasik, “Conversion between Cartesian and geodetic coordinates
on a rotational ellipsoid by solving a system of nonlinear equations,” Geodesy and Cartography 60.2 145-159 (2011).
P. Civicioglu, “Transforming geocentric cartesian coordinates to geodetic coordinates by using differential search algorithm,” Computers & Geosciences 46 229-247 (2012).