Equations of spheres
Master the equations of spheres for Year 12 Specialist Mathematics in Queensland (QCAA). A sphere is every point a fixed distance from a centre, written \(|\mathbf{r}-\mathbf{c}|=R\) or in Cartesian form \((x-a)^2+(y-b)^2+(z-c)^2=R^2\) with centre \((a,b,c)\) and radius \(R\).
You will learn to read off and build the centre and radius, complete the square to turn an expanded equation back into standard form, form a sphere from a centre and a point or from the endpoints of a diameter, and test whether a point lies inside, on, or outside — core skills in the 3D vectors topic.
Theory
A sphere is the set of all points a fixed distance from a fixed centre. In Year 12 Specialist Mathematics (QCAA, Queensland) it is written \(|\mathbf{r}-\mathbf{c}|=R\) in vector form, or in Cartesian form \((x-a)^2+(y-b)^2+(z-c)^2=R^2\) with centre \((a,b,c)\) and radius \(R\). This page reads off and builds the equation, completes the square from the expanded form, and tests whether a point lies inside, on, or outside.
A sphere is the set of all points \(\mathbf{r}\) at a fixed distance \(R\) from a fixed centre \(\mathbf{c}\). That distance condition is the vector equation \(|\mathbf{r}-\mathbf{c}|=R\): the length of the displacement from the centre to a point on the surface is exactly the radius.
Writing \(\mathbf{r}=(x,y,z)\) and \(\mathbf{c}=(a,b,c)\) and squaring both sides gives the Cartesian equation \((x-a)^2+(y-b)^2+(z-c)^2=R^2\). The centre is \((a,b,c)\) — the value that makes each bracket zero — and the radius is \(R=\sqrt{R^2}\), the square root of the right-hand side.
An expanded (general) form \(x^2+y^2+z^2+2ux+2vy+2wz+d=0\) hides the centre and radius. Completing the square in each variable turns it back into the standard form, giving centre \((-u,-v,-w)\) and radius \(\sqrt{u^2+v^2+w^2-d}\).
A sphere can also be built from a centre and a point on it (radius = the distance between them), or from the endpoints of a diameter (centre = the midpoint, radius = half the diameter length). A point \(P\) is inside, on, or outside the sphere according to whether its squared distance from the centre is less than, equal to, or greater than \(R^2\).
The vector equation of the sphere with centre \(\mathbf{c}\) and radius \(R\) is:
In coordinates, with centre \((a,b,c)\), this is the Cartesian equation:
From the expanded general form, completing the square gives:
For a sphere on the diameter \(PQ\):
How to work with the equation of a sphere
- Read off or build the centre and radius. From \((x-a)^2+(y-b)^2+(z-c)^2=R^2\) the centre is \((a,b,c)\) and \(R=\sqrt{R^2}\). Given a centre and a point, take \(R=\) their distance; given a diameter \(PQ\), take the centre as the midpoint and \(R=\tfrac{1}{2}|PQ|\).
- If the equation is expanded, complete the square in \(x\), \(y\) and \(z\) separately, moving the extra constants to the right-hand side to reveal \(R^2\).
- Write the standard form \((x-a)^2+(y-b)^2+(z-c)^2=R^2\), keeping the sign of each coordinate (a \(+3\) inside a bracket means a centre coordinate of \(-3\)).
- Test a point by computing its squared distance from the centre and comparing with \(R^2\): less than is inside, equal is on, greater than is outside.
Match each bracket to \((x-a)^2+(y-b)^2+(z-c)^2=R^2\); the centre makes every bracket zero and \(R=\sqrt{R^2}\):
| \((x-4)^2\) | \(\Rightarrow\) | \(a=4\) |
| \((y-1)^2\) | \(\Rightarrow\) | \(b=1\) |
| \((z+2)^2=(z-(-2))^2\) | \(\Rightarrow\) | \(c=-2\) |
| \(R\) | \(=\) | \(\sqrt{49}=7\) |
Centre \((4,1,-2)\), radius \(7\).
The centre is the midpoint of \(AB\):
| \(C\) | \(=\) | \(\left(\dfrac{2+6}{2},\dfrac{1+5}{2},\dfrac{3+3}{2}\right)\) |
| \(=\) | \((4,3,3)\) |
The radius is half of \(|AB|\); \(\overrightarrow{AB}=(4,4,0)\), so use \(R^2=\left(\tfrac{1}{2}|AB|\right)^2\):
| \(|AB|^2\) | \(=\) | \(4^2+4^2+0^2\) |
| \(=\) | \(32\) | |
| \(R^2\) | \(=\) | \(\dfrac{|AB|^2}{4}=\dfrac{32}{4}\) |
| \(=\) | \(8\) |
Substitute the centre and \(R^2=8\):
| \((x-4)^2+(y-3)^2+(z-3)^2\) | \(=\) | \(8\) |
\((x-4)^2+(y-3)^2+(z-3)^2=8\) (centre \((4,3,3)\), radius \(2\sqrt{2}\)).
Group each variable and complete the square, keeping the subtracted constants:
| \((x^2+4x)+(y^2-2y)+(z^2+6z)\) | \(=\) | \(-5\) |
| \((x+2)^2-4+(y-1)^2-1+(z+3)^2-9\) | \(=\) | \(-5\) |
Move the constants to the right; that number is \(R^2\):
| \((x+2)^2+(y-1)^2+(z+3)^2\) | \(=\) | \(-5+4+1+9\) |
| \((x+2)^2+(y-1)^2+(z+3)^2\) | \(=\) | \(9\) |
| \(R\) | \(=\) | \(\sqrt{9}=3\) |
Centre \((-2,1,-3)\), radius \(3\).
The centre is \((-1,3,2)\) and \(R^2=16\). Compute the squared distance \(|CP|^2\) and compare with \(R^2\):
| \(|CP|^2\) | \(=\) | \((2-(-1))^2+(6-3)^2+(2-2)^2\) |
| \(=\) | \(3^2+3^2+0^2\) | |
| \(=\) | \(18\) | |
| \(18\) | \(>\) | \(16\) |
Since \(|CP|^2=18>16=R^2\), the point \(P\) lies outside the sphere.
Common pitfalls
Frequently asked questions
What is the equation of a sphere?
A sphere with centre \((a,b,c)\) and radius \(R\) has Cartesian equation \((x-a)^2+(y-b)^2+(z-c)^2=R^2\), or in vector form \(|\mathbf{r}-\mathbf{c}|=R\), meaning every point on it is a distance \(R\) from the centre.
How do you find the centre and radius of a sphere?
From \((x-a)^2+(y-b)^2+(z-c)^2=R^2\), the centre \((a,b,c)\) is the value making each bracket zero and the radius is \(R=\sqrt{R^2}\). If the equation is expanded, complete the square first.
How do you complete the square for a sphere?
Group the \(x\), \(y\) and \(z\) terms, complete the square in each (for example \(x^2+4x=(x+2)^2-4\)), then move the extra constants to the right-hand side; that value is \(R^2\). The centre is \((-u,-v,-w)\) and \(R=\sqrt{u^2+v^2+w^2-d}\).
How do you find the equation of a sphere from a diameter?
The centre is the midpoint of the two endpoints and the radius is half the length of the diameter, so \(\mathbf{c}=\tfrac{1}{2}(\mathbf{p}+\mathbf{q})\) and \(R=\tfrac{1}{2}|PQ|\).
How do you tell if a point is inside, on, or outside a sphere?
Compare the point’s squared distance from the centre with \(R^2\): less than \(R^2\) is inside, equal to \(R^2\) is on the surface, and greater than \(R^2\) is outside.
When is a plane tangent to a sphere?
A plane is tangent to a sphere when its distance from the centre equals the radius, so the sphere touches the plane at exactly one point. For a sphere centred at \((a,b,c)\), tangency to the plane \(z=0\) means \(R=|c|\).