next up previous contents
Next: A sphere tangent to Up: Quartets of spheres Previous: Four points determine a   Contents

A sphere orthogonal to four others

Figure: Appolonius' problem of antiquity, to draw a circle tangent to three others can be generalized to finding a fifth sphere tangent to four others. Another generalization varies the angle of intersection of the spheres; the solution is very clean when the fifth sphere must be orthogonal.
\begin{figure}\begin{picture}(250,280)(-50,0)
\epsffile{fig20.eps}\end{picture}\end{figure}

To find the parameters of a sphere which is mutually orthogonal to each of four others, it is necessary to solve the four equations

\begin{eqnarray*}
\left[ \begin{array}{ccccc}
f_1 & g_1 & h_1 & -1/2 \\
f_2 ...
... \begin{array}{c} k_1 \\ k_2 \\ k_3 \\ k_4 \end{array} \right],
\end{eqnarray*}



which is a routine job of matrix inversion. Given the solution, the first three components not only locate the center of the desired sphere, they also determine its distance from the origin. With this information, the last coefficient yields the radius of the orthogonal sphere.

The program which calculates the orthogonal sphere can be made slightly more general, for arbitrary angles of intersection

void fifth(ss,r,t) double ss[][7], r, t; {
int    i, j;
double w[4][4], z[4][4], p[4][4];
double a[4], b[4], ri[4], rr, s;

for (i=0; i<4; i++) {for (j=0; j<3; j++) z[i][j]=ss[i][j]; z[i][3]=-0.5;}
for (i=0; i<4; i++) for (j=0, ri[i]=0; j<3; j++) ri[i]+=z[i][j]*z[i][j];
for (i=0; i<4; i++) a[i]=0.5*(ri[i]-ss[i][3]);
if (t!=0.0) for (i=0; i<4; i++) {
  s=(r>0?sqrt(r):sqrt(-r));
  a[i]+=s*t*sqrt(ri[i]);
  }
geomi4(w,z);
for (i=0; i<4; i++) for (j=0, b[i]=0.0; j<4; j++) b[i]+=w[i][j]*a[j];
rr=b[0]*b[0]+b[1]*b[1]+b[2]*b[2]-b[3];
ss[4][0]=b[0]; ss[4][1]=b[1]; ss[4][2]=b[2]; ss[4][3]=rr;
}


next up previous contents
Next: A sphere tangent to Up: Quartets of spheres Previous: Four points determine a   Contents
Pedro Hernandez 2004-05-13