8 planes tangent 3 spheres in the space

129 Views Asked by At

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)$

2

There are 2 best solutions below

3
On BEST ANSWER

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}$$

1
On

As you said, the plane that you're looking for has the equation

$ n \cdot (x - x_0) = 0 $

The plane has to satisfy that the distance of the centers from the plane are $r_1, r_2, r_3$.

So if $x_1 , x_2, x_3$ are the position vectors of the three centers then we want to solve

$ | n \cdot (x_1 - x_0) | = r_1 $

$ | n \cdot (x_2 - x_0) | = r_2 $

$ | n \cdot (x_3 - x_0) | = r_3 $

where $n$ also satisfies, $n \cdot n = 1 $

To solve these four equations, define

$ s_1 = \operatorname{sgn}(n \cdot (x_1 - x_0) ) $

$ s_2 = \operatorname{sgn}( n \cdot (x_2 - x_0) ) $

$ s_3 = \operatorname{sgn}(n \cdot (x_3 - x_0 ) ) $

where $\operatorname{sgn}$ is the sign function returning values of $+1$ or $-1$.

Then, assuming $r_1 , r_2 , r_3 \gt 0 $, the equations become

$ n \cdot (x_1 - x_0) = s_1 r_1 $

$ n \cdot (x_2 - x_0) = s_2 r_2 $

$ n \cdot (x_3 - x_0) = s_3 r_3 $

Taking the difference between the first and second equations, and then the difference between the first and third equations, leads to

$ n \cdot (x_1 - x_2) = s_1 r_1 - s_2 r_2 $

$ n \cdot (x_1 - x_3) = s_1 r_1 - s_3 r_3 $

This is a linear system of $2$ equations in $3$ unknowns (which are the components of $n$). Therefore, the solution will take the form

$ n = n_0 + t n_1 $

where $n_0$ and $n_1$ have been obtained by the Gauss-Jordan elimination process, and $t \in \mathbb{R}$ is yet to be determined.

To determine $t$, we just impose $n \cdot n= 1 $, and this translates into,

$ (n_1 \cdot n_1) t^2 + 2 t (n_1 \cdot n_0) + (n_0 \cdot n_0) - 1 = 0 $

This will give $0, 1,$ or $2$ solutions. Once we have $n$ we can obtain the constant $(n \cdot x_0)$ from the first of the original equations, namely,

$ d = n \cdot x_0 = n \cdot x_1 - s_1 r_1 $

so that the plane is completely determined.

Note that if we reverse all the signs of the linear system, then the obtained normal vector will be just the negative of the one obtained with the original signs. So if we obtain $ n $ with $s_1 = 1 , s_2 = -1, s_3 = -1 $, then we will obtain $ - n $ with $s_1 = -1, s_2 = 1, s_3 = 1 $. Therefore, we only need to take the following combinations

$ ( +, + , + ) , (+, +, - ) , (+, - , + ), ( -, + , + ) $

And this will generate two planes for each of the signs triple, making a total of $8$ possible planes.