I am trying to inscribe a sphere, in the first octant, inside the ellipsoid
$$ \dfrac{x^2}{a^2 } + \dfrac{y^2}{b^2} + \dfrac{z^2}{c^2} = 1 \tag{1}$$
such that the sphere is tangent to the three coordinate planes and the ellipsoid.
My attempt
The sphere has the equation
$$ (x - R)^2 + (y - R)^2 + (z - R)^2 = R^2 \tag{2}$$
So I am looking for ways to find $R$ such that the intersection of $(1)$ and $(2)$ is a single point, which is the tangency point. So, I expressed the tangency point $P (x, y, z)$ in terms of two spherical coordinates parameters $\theta, \phi$ as follows
$$ P = (x, y, z) = (a \sin \theta \cos \phi , b \sin \theta \sin \phi, c \cos \theta ) $$
The gradient of the ellipsoid at $P$ is
$$ g = 2 \left( \frac{1}{a} \sin \theta \cos \phi , \frac{1}{b} \sin \theta \sin \phi, \frac{1}{c} \cos \theta \right) $$
Now I expressed the fact that at tangency, the normal to the ellipsoid (which is along the gradient) passes through the center of the sphere, and the distance between the tangency point and the center of the sphere is the radius of the sphere. This means that
$$ P(x,y,z) = R (1, 1, 1) + R \dfrac{g}{\| g \|} $$
Results:
The above vector equation is three scalar equations, in the three unknowns $\theta, \phi$ and $R$. I used the multivariate Newton-Raphson method, with numerical evaluation of the Jacobian, to solve them, for the ellipsoid with $a = 12, b = 25, c = 6 $.
The Newton-Raphson method converged in $5$ iterations, and I got the radius equal to $R = 2.8784$ and the tangency point $P$
$$P = (x, y, z) = (3.2872, 2.9633 , 5.7265) $$
I would appreciate verification of these values, and also any hints or other answers.