[Math] Equation of a sphere as the determinant of its variables and sampled points

analytic geometrydeterminant

Searching for an equation to find the center of a sphere given 4 points, one finds that taking the determinant of the four (non-coplanar) points together with the variables $x$, $y$, and $z$ arranged like so:

$\left|\begin{array}{ccccc}
x^2+y^2+z^2 & x & y&z&1\\
x_1^2 + y_1^2 + z_1^2 & x_1 & y_1 & z_1 & 1\\
x_2^2 + y_2^2 + z_2^2 & x_2 & y_2 & z_2 & 1\\
x_3^2 + y_3^2 + z_3^2 & x_3 & y_3 & z_3 & 1\\
x_4^2 + y_4^2 + z_4^2 & x_4 & y_4 & z_4 & 1\\
\end{array}\right| = 0$

yields the equation for the sphere. Then one need only re-arrange terms into the more familiar form to find the center and radius. This works fine. My question is why.

This same approach also works for one or two dimensions. I'm guessing it also works for finding hyperspheres in higher-dimensional spaces as long as you have a corresponding number of points. But where did that determinant form come from? Is there an intuitive meaning for what that relationship is saying?

Best Answer

The equation of a sphere of radius $r$ centred at $(u,v,w)$ is $(x - u)^2 + (y-v)^2 + (z-w)^2 = r^2$, or $x^2 + y^2 + z^2 + U x + V y + W z + C = 0$ where $C = u^2 + v^2 + w^2 - r^2$, $U = -2u$, $V=-2v$, $W=-2w$. If $A$ is the matrix you're taking the determinant of, to have this equation satisfied for the four given points and an arbitrary point $(x,y,z)$ on the sphere means $$A \pmatrix{1\cr U\cr V\cr W\cr C\cr} = \pmatrix{0\cr 0\cr 0\cr 0\cr0\cr}$$ But for that to happen, $\det A$ must be $0$. Conversely, if $\det A = 0$, there exist $T,U,V,W,C$ not all $0$ for which $$A \pmatrix{T\cr U\cr V\cr W\cr C\cr} = \pmatrix{0\cr 0\cr 0\cr 0\cr0\cr}$$
If $T \ne 0$ we may divide by it and get an equation of a sphere going through the points. If $T = 0$ we have a degenerate case where the "sphere" is actually a plane.

Yes, this generalizes to any number of dimensions.

Related Question