Given a vector of N-dimensional points. The vector will be of size N+1.
Is there a generalized algorithm to find the center and radius of the ND sphere using those points where the sphere intersects every single one of those points?
Given a vector of N-dimensional points. The vector will be of size N+1.
Is there a generalized algorithm to find the center and radius of the ND sphere using those points where the sphere intersects every single one of those points?
On
The center of a circle by three points, let (X, Y) and its radius R are found as follows:
(X - X0)² + (Y - Y0)² = R²
(X - X1)² + (Y - Y1)² = R²
(X - X2)² + (Y - Y2)² = R²
Then subtracting pair-wise to eliminate R,
(2X - X0 - X1)(X1 - X0) + (2Y - Y0 - Y1)(Y1 - Y0) = 0
(2X - X0 - X2)(X2 - X0) + (2Y - Y0 - Y2)(Y2 - Y0) = 0
This is a system of two linear equations in two unknowns, giving the coordinates of the center (in fact we construct the intersection of two bisectors). The radius follows from the first equation.
This immediately generalizes to D dimensions.
The same question has been asked on the mathematics stackexchange and has received a constructive answer:
Here is an implementation in python/numpy of the algorithm described at that answer.
To test this method, we can generate random points on the surface of a sphere, using the method described in this related question: