Equation of the sphere that passes through 4 points Write he equation of the sphere that passes through points
$$a(-5,4,1),b(3,4,-5),c(0,0,4),d(0,0,0)$$
I tried to use four points to draw a geometric shape and then calculate the center of this shape on the basis of the circle that passing  on four points. But I did not succeed

Here is the book answer
  $$x^2+y^2+z^2+54x−58y+4z=0$$


The equation of the sphere with a centre in $(x_0,y_0,z_0) $ and radius $r $ is: $(x-x_0)^2+(y-y^0)^2+(z-z_0)^2=r^2$. For us, the unknowns are $x_0,y_0,z_0,r $.
Plug the given four points in:
$$\begin {align}(-5-x_0)^2+(4-y_0)^2+(1-z_0)^2=r^2 \\ (3-x_0)^2+(4-y_0)^2+(-5-z_0)^2=r^2 \\ (-x_0)^2+(-y_0)^2+(4-z_0)^2=r^2 \\  (-x_0)^2+(-y_0)^2+(-z_0)^2=r^2\end {align} $$
or (after a bit of transforming):
$$\begin {align}42+10x_0-8y_0-2z_0+x_0^2+y_0^2+z_0^2=r^2 \\ 50-6x_0-8y_0+10z_0+x_0^2+y_0^2+z_0^2=r^2 \\ 16-8z_0+x_0^2+y_0^2+z_0^2=r^2 \\ x_0^2+y_0^2+z_0^2=r^2\end {align} $$
Now, take away one of the equations from the rest (in this case, the last one is the easiest one):
$$\begin {align}42+10x_0-8y_0-2z_0=0 \\ 50-6x_0-8y_0+10z_0=0\\ 16-8z_0=0\\ x_0^2+y_0^2+z_0^2=r^2\end {align} $$
Solve the system of the first three (linear) equations, to obtain: $x_0=2, y_0=\frac {29}{4}, z_0=2$. Plug that into the fourth to obtain $r=\sqrt {2^2+\left (\frac {29}{4}\right)^2+2^2}=\frac {\sqrt {969}}{4}$.
Thus, the final equation is:
$$(x-2)^2+(y-\frac {29}{4})^2+(z-2)^2=\frac {969}{16} $$
or, after transforming:
$$x^2+y^2+z^2-4x-\frac {29}{2}y-4z=0$$
as all constant terms will happen to cancel each other.
