Given the four known spheres of centers $C_1, C_2, C_3, C_4 $ and radii $r_1, r_2, r_3, r_4 $, we want to determine $C$ and $R \gt 0$ such that
$ R + r_1 = \| C C_1 \| = \sqrt{ (C - C_1)^T (C - C_1) }$
$ R + r_2 = \| C C_2 \| =\sqrt{ (C - C_2)^T (C - C_2) }$
$ R + r_3 = \| C C_3 \| =\sqrt{ (C - C_3)^T (C - C_3) }$
$ R + r_4 = \| C C_4 \| = \sqrt{ (C - C_4)^T (C - C_4) }$
Square each of the above four equations and take the differences between the first and the second, the first and the third, the first and the fourth, we get
the following three equations,
$ 2 R (r_1 - r_2) + r_1^2 - r_2^2 = - 2 C^T (C_1 - C_2) + C_1^T C_1 - C_2^T C_2 $
$ 2 R (r_1 - r_3) + r_1^2 - r_3^2 = - 2 C^T (C_1 - C_3) + C_1^T C_1 - C_3^T C_3 $
$ 2 R (r_1 - r_4) + r_1^2 - r_4^2 = - 2 C^T (C_1 - C_4) + C_1^T C_1 - C_4^T C_4 $
which are $3$ linear equations in $4$ unknowns. Feeding these to a linear equation solver, gives
$ X = V_0 + t V_1 $
where $X = [ C_x, C_y, C_z, R]^T$ and $V_0, V_1$ are known vectors, and $t \in \mathbb{R} $
To find $t$, substitute this expression into the equation
$ (R + r_1)^2 = (C - C_1)^T (C - C_1) $
and solve for $t$, this will give two values of $t$, take the one that gives a positive value for $R$.
EDIT:
A slightly different way to determine $R$ is as follows:
Let $C = C_1 + v $ where $v $ is a vector, $v \in \mathbb{R}^3$, the above equations become
$ (R + r_1)^2 = \| C C_1 \|^2 = (C - C_1)^T (C - C_1) = v^T v \hspace{30pt} (*) $
$\begin{equation} \begin{split}
(R + r_2)^2 &= \| C C_2 \|^2 = (C - C_2)^T (C - C_2) \\ &= (C_1 - C_2 + v)^T (C_1 - C_2 + v) \\&= \| C1 - C_2 \|^2 + 2 (C_1 - C_2)^T v + v^T v \end{split}\end{equation}$
Similarly,
$ (R + r_3)^2 = \| C C_3 \|^2 =\| C1 - C_3 \|^2 + 2 (C_1 - C_3)^T v + v^T v $
$ (R + r_4)^2 = \| C C_4 \|^2 = \| C1 - C_4 \|^2 + 2 (C_1 - C_4)^T v + v^T v $
Substituting $(*)$ in the above three equations, and re-arranging,
$ 2 R (r_2 - r_1) + r_2^2 - r_1^2 = \| C1 - C_2 \|^2 + 2 (C_1 - C_2)^T v $
$ 2 R (r_3 - r_1) + r_3^2 - r_1^2 = \| C1 - C_3 \|^2 + 2 (C_1 - C_3)^T v $
$ 2 R (r_4 - r_1) + r_4^2 - r_1^2 = \| C1 - C_4 \|^2 + 2 (C_1 - C_4)^T v $
These three equations can be written in matrix-vector form as follows:
Let $A = \begin{bmatrix} (C_1 - C_2)^T \\ (C_1 - C_3)^T \\ (C_1 - C_4)^T \end{bmatrix} $
and let $ b = \begin{bmatrix} r_2 - r_1 \\ r_3 - r_1 \\ r_4 - r_1 \end{bmatrix} $
and let $ c = \dfrac{1}{2} \begin{bmatrix} r_2^2 - r_1^2 - \| C_1 - C_2 \|^2 \\ r_3^2 - r_1^2 - \| C_1 - C_3 \|^2\\ r_4^2 - r_1^2 - \| C_1 - C_4 \|^2 \end{bmatrix} $
Then
$ A v = R b + c $
Hence, by pre-multiplying by the inverse of $A$
$ v = R A^{-1} b + A^{-1} c $
Now substitute this into the very first equation,
$ R^2 + 2 R r_1 + r_1^2 = v^T v = R^2 \bigg(b^T A^{-T} A^{-1} b\bigg) + 2 R \bigg( b^T A^{-T} A^{-1} c \bigg) + \bigg(c^T A^{-T} A^{-1} c\bigg) $
And this is a single quadratic equation in $R$ which can be solve to produce two solutions, out of which we'll take the positive one.
Two-Dimensional Case:
Following the second method above, we have now three circles with centers $C_1, C_2 , C_3 \in \mathbb{R}^2 $ and radii $r_1, r_2, r_3 $.
The center of the circle we want is $C \in \mathbb{R}^2 $ and its radius is $R$.
Let $ C = C_1 + v $ where $v \in \mathbb{R}^2 $, then the equations governing the relations between the radii and the coordinates of the centers are:
$ \| C - C_1 \|^2 = v^T v = (r_1 + R)^2 $
$ \| C - C_2 \|^2 = \| C_1 - C_2 + v \|^2 = v^T v + 2 (C_1 - C_2)^T v + \| C_1 - C_2 \|^2 = (r_2 + R)^2$
Use the first equation to replace $v^T v$ with $ (r_1 + R)^2 $, then
$ (r_2 + R)^2 = (r_1 + R)^2 + 2 (C_1 - C_2)^T v + \| C_1 - C_2 \|^2$
Cancel $R^2$ on both sides of this equation. This gives us,
$ 2 R (r_2 - r_1) + r_2^2 - r_1^2 - \| C_1 - C_2 \|^2 = 2 (C_1 - C_2)^T v $
And similarly, we have
$ 2 R (r_3 - r_1) + r_3^2 - r_1^2 - \| C_1 - C_3 \|^2 = 2 (C_1 - C_3)^T v $
Now define the $2 \times 2$ matrix $A$ and vectors $b$ and $c$ as follows
$ A = \begin{bmatrix} (C_1 - C_2)^T \\ (C_1 - C_3)^T \end{bmatrix} $
$ b = \begin{bmatrix} r_2 - r_1 \\ r_3 - r_1 \end{bmatrix} $
$ c = \dfrac{1}{2} \begin{bmatrix} r_2^2 - r_1^2 - \| C_1 - C_2 \|^2 \\
r_3^2 - r_1^2 - \| C_1 - C_3 \|^2 \end{bmatrix} $
Then our two equations above becomes in matrix-vector form as follows
$ A v = R b + c $
From which
$ v = R A^{-1} b + A^{-1} c $
The first equation is
$ (R + r_1)^2 = v^T v $
Substitute $v$, this becomes
$ R^2 + 2 R r_1 + r_1^2 = R^2 \bigg( b^T A^{-T}A^{-1} b \bigg) + 2 R \bigg( b^T A^{-T} A^{-1} c \bigg) + \bigg( c^T A^{-T} A^{-1} c \bigg) $
which is a quadratic equation in $R$, and can be solved using the quadratic formula. As before, select the positive value of $R$. Once we have $R$, we can calculate $v$ and then $C$.
The figure below shows a example run of the above method.
