I know it might seem like a trivial question, but I think the result is very long and I wanted a consultation to find a "smart" way to solve it without wasting hours of time on unnecessarily long calculations.
I was looking for a "compact" algorithm for calculating the equations of the $8$ tangent planes $3$ generic spheres in space.
I found the $2D$ version (i.e. $4$ tangent lines $2$ circles)
$$\begin{cases} (x-x_1)^2+(y-y_1)^2=r_1^2\\(x-x_2)^2+(y-y_2)^2=r_2^2\end{cases}\qquad{\color{gray}{\left[\begin{matrix}d_x=x_2-x_1\qquad d_y=y_2-y_1\\d=\sqrt{e^2+f^2} \end{matrix}\right.}}$$
$$r: y-y_0=m(x-x_0)$$ Where $$\begin{array}{|c||c|c|}\hline&\text{Internal}&\text{External}\\\hline(x_0,y_0)&\left(\dfrac{x_2 r_1+x_1 r_2}{r_1+r_2},\dfrac{y_2 r_1+y_1 r_2}{r_1+r_2}\right)&\left(\dfrac{x_2 r_1-x_1 r_2}{r_1-r_2},\dfrac{y_2 r_1-y_1 r_2}{r_1-r_2}\right)\\m&\dfrac{d_xd_y\pm(r_1+r_2)\sqrt{d^2-(r_1+r_2)^2}}{d_x^2-(r_1+r_1)^2}&\dfrac{d_xd_y\pm(r_1-r_2)\sqrt{d^2-(r_1-r_2)^2}}{d_x^2-(r_1-r_2)^2}\\\hline\end{array}$$
I wanted to generalize to $$\begin{cases} (x-x_1)^2+(y-y_1)^2+(z-z_1)^2=r_1^2\\(x-x_2)^2+(y-y_2)^2+(z-z_2)^2=r_2^2\\(x-x_3)^2+(y-y_3)^2+(z-z_3)^2=r_3^2\end{cases}$$ The fact that they are 8 makes me think that the result depends on a kind of "binary code" understood as the alternation of signs of 3 elements (something like $\pm a_1\pm a_2\pm a_3$,seeing the formula for the $2D$ case I guess it could be the radius)
I was thinking that maybe a "vectorial" version of the problem could be useful too, ie $$\begin{cases} \Vert\mathbf{x}-\mathbf{x}_1\Vert=r_1\\ \Vert\mathbf{x}-\mathbf{x}_2\Vert=r_2\\ \Vert\mathbf{x}-\mathbf{x}_3\Vert=r_3 \end{cases}$$
and the result expressed as a dot product
$$\langle \mathbf{x}-\mathbf{x}_0,\mathbf{a}\rangle=0$$
Where $\mathbf{x}:=(x,y,z)$, $\mathbf{x}_0:=(x_0,y_0,z_0)$ and $\mathbf{a}:=(a,b,c)$
Many thanks to those who replied or tried to think about it, but in the end I started to calculate it in a compact way:
Given $$\begin{cases}\Vert\mathbf{x}-\mathbf{x}_1\Vert=r_1\\ \Vert\mathbf{x}-\mathbf{x}_2\Vert=r_2\\ \Vert\mathbf{x}-\mathbf{x}_3\Vert=r_3 \end{cases}\quad{\color{gray}{\Rightarrow \left[\begin{matrix}\mathbf{S}=(\mathbf{x}_2-\mathbf{x}_1)\times(\mathbf{x}_3-\mathbf{x}_1)\\ \mathbf{T}_{\pm}^{\pm}:=\mathbf{T}=\begin{vmatrix} \mathbf{x}_2-\mathbf{x}_1&r_1\pm r_2\\ \mathbf{x}_3-\mathbf{x}_1&r_1\pm r_3\\ \end{vmatrix}\end{matrix}\right.} } $$ $$\mathbf{a}_{\pm}=\mathbf{a}:=\frac{\mathbf{S}\times\mathbf{T}}{\Vert\mathbf{S}\Vert^2}\pm\frac{\mathbf{S}}{\Vert\mathbf{S}\Vert}\sqrt{1-\frac{\Vert\mathbf{T}\Vert^2}{\Vert\mathbf{S}\Vert^2}}$$
$$\pi:\langle\mathbf{x}-\mathbf{x}_1,\mathbf{a}\rangle=r_1$$
by alternating the signs of $\mathbf{a}$ and $\mathbf{T}$ we have the 8 planes:
$$\begin{array}{|c|c|c|c|}\hline (\mathbf{T}^{+}_{+},\mathbf{a}_+)&(\mathbf{T}^{+}_{-},\mathbf{a}_+)&(\mathbf{T}^{-}_{+},\mathbf{a}_+)&(\mathbf{T}^{-}_{-},\mathbf{a}_+)\\ (\mathbf{T}^{+}_{+},\mathbf{a}_-)&(\mathbf{T}^{+}_{-},\mathbf{a}_-)&(\mathbf{T}^{-}_{+},\mathbf{a}_-)&(\mathbf{T}^{-}_{-},\mathbf{a}_-)\\\hline \end{array}$$