<s>[INST] Equation of sphere through variable points and origin Question : Find the equation of the sphere through four points $(0,0,0) , (-a,b,c) , (a,-b,c)$ and $(a,b,-c)$. Also find the centre and the radius of the sphere.
Now I know that the sphere passes through origin. Therefore, the constant term in the equation of the sphere will be $0$.
According to standard equation the equation of sphere will look like :
$$x^2 + y^2 + z^2 + 2ux + 2vy + 2wz + d = 0$$
Here the centre is $(u,v,w)$ is the centre and $d = 0$ because the sphere passes through origin. 
Now while trying to get the equation by using points I'm getting nowhere. Is there any way to solve this easily?
I don't know what to do in this. Kindly help.
 [/INST] The four points form two triangles on the sphere. The planes on which these triangles lie, intersect the sphere in two circles, which are the circumscribed circles of the two triangles. The two lines perpendicular to the planes, through the center of the circles, intersect each other in the center of the sphere. The center of each circle is the intersection point of the perpendicular lines on the three sides of the triangle.
First look at the triangle composed by $(0,0,0), (-a,b,c)$ and $(a,-b,c)$: the perpendicular vector is the vector product of two of the vectors composing the triangle sides, thus
$$\vec{n_1} = \left(\begin{matrix}-a\\ b \\ c\end{matrix}\right) \times \left(\begin{matrix}a\\ -b \\ c\end{matrix}\right) = \left(\begin{matrix}2bc\\ 2ac \\ 0\end{matrix}\right) \equiv \left(\begin{matrix}b\\ a \\ 0\end{matrix}\right)$$
The intersection of the perpendicular lines can be derived from the fact that the sides itself are the perpendiculars to the planes that intersect into that same point. These perpendicular vectors and points on these three planes are:
$$
\begin{cases}
\left(\begin{matrix}-a\\ b \\ c\end{matrix}\right) passing through \frac{1}{2}(-a,b,c)\\
\left(\begin{matrix}a\\ -b \\ c\end{matrix}\right) passing through \frac{1}{2}(a,-b,c)\\
\left(\begin{matrix}a\\ -b \\ 0\end{matrix}\right) passing through (0,0,c)
\end{cases}
$$
Thus that point is a solution to the following set of equations (as the three planes perpendicular to the triangle sides intersect into a line, the equation for the triangle plane itself, which passes through (0,0,0), has to be included):
$$
\begin{cases}
-ax+by+cz &= \frac{1}{2}(a^2+b^2+c^2)\\
ax-by+cz &= \frac{1}{2}(a^2+b^2+c^2)\\
ax-by &= 0\\
bx+ay &= 0
\end{cases}
$$
Which leads to the following point that is the center of the circumscribed circle: $(0,0,\frac{a^2+b^2+c^2}{2c})$
The first line through the sphere's center thus has the following vector specification:
$$\left(\begin{matrix}x\\ y \\ z\end{matrix}\right)=\left(\begin{matrix}0\\ 0 \\ \frac{a^2+b^2+c^2}{2c}\end{matrix}\right) + \lambda\left(\begin{matrix}b\\ a \\ 0\end{matrix}\right)$$
Similar for the other intersection point of the three perpendicular lines of the second triangle (composed by $(a,b,-c), (-a,b,c)$ and $(a,-b,c)$): perpendicular vector is
$$\vec{n_2} = \left(\begin{matrix}0\\ -b \\ c\end{matrix}\right) \times  \left(\begin{matrix}a\\ -b \\ 0\end{matrix}\right) = \left(\begin{matrix}bc\\ ac \\ ab\end{matrix}\right)$$
$$
\begin{cases}
\left(\begin{matrix}a\\ -b \\ 0\end{matrix}\right) passing through (0,0,c)\\
\left(\begin{matrix}0\\ -b \\ c\end{matrix}\right) passing through (a,0,0)\\
\left(\begin{matrix}a\\ 0 \\ -c\end{matrix}\right) passing through (0,b,0)
\end{cases}
$$
Thus that point is a solution to all of the following set of equations (including the equation for the triangle plane itself, which passes through (a,0,0)):
$$
\begin{cases}
-by+cz &= 0\\
ax-cz &= 0\\
ax-by &= 0\\
bcx+acy+abz &= abc
\end{cases}
$$
Which you may wish to solve into the point that is the center of the second circumscribed circle, but in this case we can see that the radius line also passes through (0,0,0), and thus the second line through the sphere's center has the following vector specification:
$$\left(\begin{matrix}x\\ y \\ z\end{matrix}\right)= \mu\left(\begin{matrix}bc\\ ac \\ ab\end{matrix}\right)$$
Intersecting the two lines gives $\mu=\frac{a^2+b^2+c^2}{2abc}$, and hence the center of the sphere is
$$\vec{M}= \frac{a^2+b^2+c^2}{2abc}\left(\begin{matrix}bc\\ ac \\ ab\end{matrix}\right)$$ and the length of that vector is the radius (as the sphere passes through the origin), hence
$$r=\frac{a^2+b^2+c^2}{2abc} \cdot \sqrt{b^2c^2+a^2c^2+a^2b^2}$$
EDIT
The points of intersection of the perpendicular lines for each triangle actually do not have to be derived, not even for the first triangle above. It is simpler to state that the planes perpendicular to the sides intersect into the sphere radius. One triangle side is shared among the two triangles, so instead of the above, we can solve the following set of equations:
$$
\begin{cases}
-ax+by+cz &= \frac{1}{2}(a^2+b^2+c^2)\\
ax-by+cz &= \frac{1}{2}(a^2+b^2+c^2)\\
ax-by &= 0\\
-by+cz &= 0\\
ax-cz &= 0\\
\end{cases}
$$
from which it follows that $ax=by=cz$ and $ax=\frac{a^2+b^2+c^2}{2}$ thus $x=\frac{a^2+b^2+c^2}{2a}$, etcetera.
</s>