Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Specialist (Unit 3 & 4) Vectors in two and three dimensions

Equations of spheres

20 practice questions 0 video lessons Theory + worked examples

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.

Create a free accountTrack your progress and save your work as you go.
Create free account

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\).

Equation of a sphere: centre and radius A circle stands for a sphere shown as its great-circle cross-section, with a centre dot labelled C(a,b,c) and a radius R drawn to the rim, inside small isometric x, y and z axes. Its equation is (x minus a) squared plus (y minus b) squared plus (z minus c) squared equals R squared. x y z C(a,b,c) R radius R
A sphere of centre \((a,b,c)\) and radius \(R\): \((x-a)^2+(y-b)^2+(z-c)^2=R^2\).
Point inside, on, or outside a sphere A circle stands for a sphere of centre C and radius R. Point P lies inside because its distance from C is less than R, point Q lies on the surface because its distance equals R, and point S lies outside because its distance is greater than R. C P Q S P: ∣CP∣<R    Q: ∣CQ∣=R    S: ∣CS∣>R
Inside, on, or outside: compare the distance \(|CP|\) from the centre with the radius \(R\).

The vector equation of the sphere with centre \(\mathbf{c}\) and radius \(R\) is:

\[ |\mathbf{r}-\mathbf{c}|=R \]
|rc|=R

In coordinates, with centre \((a,b,c)\), this is the Cartesian equation:

\[ (x-a)^2+(y-b)^2+(z-c)^2=R^2 \]
(xa)2+=R2

From the expanded general form, completing the square gives:

\[ x^2+y^2+z^2+2ux+2vy+2wz+d=0 \;\Rightarrow\; \text{centre }(-u,-v,-w),\ R=\sqrt{u^2+v^2+w^2-d} \]
R=u2+v2+w2d

For a sphere on the diameter \(PQ\):

\[ \mathbf{c}=\tfrac{1}{2}(\mathbf{p}+\mathbf{q}),\qquad R=\tfrac{1}{2}|PQ| \]
c=12(p+q)
Inside, on, or outside. For a point \(P\), compare its squared distance from the centre with \(R^2\): \(|CP|^2inside, \(|CP|^2=R^2\) is on the surface, and \(|CP|^2>R^2\) is outside. Squared distances avoid any surds.

How to work with the equation of a sphere

  1. 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|\).
  2. 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\).
  3. 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\)).
  4. 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.
Example 1 — Read off centre and radius
Write down the centre and radius of the sphere \((x-4)^2+(y-1)^2+(z+2)^2=49\).
Solution

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\).

Example 2 — Sphere on a diameter
A sphere has a diameter with endpoints \(A(2,1,3)\) and \(B(6,5,3)\). Find its Cartesian equation.
Solution

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}\)).

Example 3 — Completing the square
Find the centre and radius of the sphere \(x^2+y^2+z^2+4x-2y+6z+5=0\).
Solution

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\).

Example 4 — Inside, on, or outside
Determine whether the point \(P(2,6,2)\) lies inside, on, or outside the sphere \((x+1)^2+(y-3)^2+(z-2)^2=16\).
Solution

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

Sign of the centre coordinates. The centre makes each bracket zero, so \((y+3)^2=(y-(-3))^2\) gives a centre coordinate of \(-3\), not \(+3\). Watch out for copying the sign straight out of the bracket.
Confusing \(R\) with \(R^2\). The right-hand side is \(R^2\), not the radius. A sphere \(\dots=25\) has radius \(5\), and one \(\dots=20\) has radius \(\sqrt{20}=2\sqrt{5}\) — take the square root.
Dropping the constants when completing the square. Each completed bracket adds a constant that must be carried across: \((x+2)^2-4\), \((y-1)^2-1\). Forgetting them gives the wrong \(R^2\).
Comparing distance instead of distance squared. For inside/on/outside, compare \(|CP|^2\) with \(R^2\) — both squared — so you never need to take a square root.

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|\).