Condition for three points to lie on a Sphere? If A and B are the points (3,4,5) and (-1,3,-7) respectively then the set of the points P such that $PA^2+PB^2 = K^2$ where K is a constant lie on a proper sphere if K = 1 or K^2 <>= 161/2?
The correct answer is K^2 > 161/2. How?
I know that three non - collinear points always lie on one and only one circle but I don't know similar thing about a sphere. Probably we have to use pythagoras theorem but I'm not sure. Can someone help?

Note first that the distance between $A$ and $B$ is $\sqrt{161}$. Let $C(1,\frac{7}{2},-1)$ be the midpoint of $AB$ and let $r=\frac{1}{2}\sqrt{2K^2-161}$. Take any point $P(x,y,z)$.
We have $PA^2+PB^2=(x-3)^2+(y-4)^2+(z-5)^2+(x+1)^2+(y-3)^2+(z+7)^2=2x^2+2y^2+2z^2-4x-14y+4z+109=2(x-1)^2+2(y-\frac{7}{2})^2+2(z+1)^2+\frac{161}{2}=2\cdot PC^2+\frac{161}{2}$.
So $PA^2+PB^2=K^2$ iff $K^2=2\cdot PC^2+\frac{161}{2}$ or $PC^2=\frac{1}{2}\sqrt{2K^2-161}=r^2$. In other words, the locus of $P$ is the sphere centre $C$ radius $r$.
