Back to the blog

Lines and circles · 8 min read

Lines and circles: the equation of a circle

From Pythagoras to (x − a)² + (y − b)² = r². Read off the centre and radius, complete the square, and find where a line meets a circle.

A goat is tied to a post with a rope of 5 metres. It can graze anywhere the rope reaches. The edge of that patch of grass is a circle.

Every point on that edge is exactly 5 metres from the post. That is also the maths definition. A circle is all the points at the same distance from one fixed point. The fixed point is the centre M. The distance is the radius r.

In this article you turn that definition into an equation. Then you read the centre and radius off an equation. At the end you make a line cut through a circle.

From Pythagoras to the equation

Take a circle with centre M(1, 1) and radius 5. Pick a point P(x, y) on the circle. Walk from M horizontally until you are straight below P. Then walk straight up to P. This gives a right triangle.

  • The horizontal side is x − 1.
  • The vertical side is y − 1.
  • The hypotenuse is the radius: 5.

Pythagoras then gives:

(x − 1)² + (y − 1)² = 5² = 25

Take P(4, 5). Then x − 1 = 3 and y − 1 = 4. You get 3² + 4² = 9 + 16 = 25. So P is on the circle.

Drag P around the circle
  • Circle (x − 1)² + (y − 1)² = 25
  • Radius MP = 5
  • Shorter sides
−4−20246−4−20246xyMP
Point P
(4, 5)
Horizontal side
x − 1 = 3
Vertical side
y − 1 = 4
Pythagoras
3² + 4² = 9 + 16 = 25
The radius is always the hypotenuse of a right triangle. P snaps to the twelve grid points.
Show the numbers
Point Px − 1y − 1(x − 1)² + (y − 1)²
(−3, −2)−4−316 + 9 = 25
(−2, −3)−3−49 + 16 = 25
(1, −4)0−50 + 25 = 25
(4, −3)3−49 + 16 = 25
(5, −2)4−316 + 9 = 25
(6, 1)5025 + 0 = 25
(5, 4)4316 + 9 = 25
(4, 5)349 + 16 = 25
(1, 6)050 + 25 = 25
(−2, 5)−349 + 16 = 25
(−3, 4)−4316 + 9 = 25
(−4, 1)−5025 + 0 = 25

If P is to the left of M, then x − 1 is negative. Its square is still positive. So the equation works for every point on the circle.

This holds for every circle. With centre M(a, b) and radius r, the equation of the circle is:

(x − a)² + (y − b)² = r²

Reading off the centre and radius

You can also read the equation the other way round. Take this circle:

(x − 2)² + (y + 1)² = 13

Next to x is − 2, so a = 2. Next to y is + 1. Write that as y − (−1) and you see b = −1. The centre is M(2, −1).

On the right is r² = 13. So the radius is r = √13 ≈ 3.61.

Drag the centre, slide the radius

(x − 2)² + (y + 1)² = 16

  • Circle
  • Radius
−6−4−20246−6−4−20246xyrM
Centre
M(2, −1)
Radius
r = 4, r² = 16
Without brackets
x² + y² − 4x + 2y − 11 = 0
The number inside the brackets has the opposite sign to the coordinate of M.
Show the numbers
Point(x − 2)² + (y + 1)²
(6, −1)4² + 0² = 16
(2, 3)0² + 4² = 16
(−2, −1)(−4)² + 0² = 16
(2, −5)0² + (−4)² = 16

What are the centre and radius of (x + 3)² + (y − 5)² = 49?

Show the answer

x + 3 = x − (−3), so a = −3. Next to y is − 5, so b = 5. The centre is M(−3, 5). On the right is r² = 49, so r = √49 = 7.

On, inside or outside the circle

The left-hand side of the equation is the square of the distance to M. Substitute a point and compare the result with r².

  • If the result equals r², the point is on the circle.
  • If the result is less than r², the point is inside the circle.
  • If the result is greater than r², the point is outside the circle.

Take (x − 2)² + (y + 1)² = 13 again.

Q(4, 2): (4 − 2)² + (2 + 1)² = 4 + 9 = 13, so on the circle
Q(3, 0): (3 − 2)² + (0 + 1)² = 1 + 1 = 2, so inside the circle

Drag Q around the grid below. Eight grid points lie on this circle. A grid point has whole numbers as coordinates. Find all eight. A hint: 13 = 4 + 9.

On, inside or outside
  • Circle (x − 2)² + (y + 1)² = 13
  • Inside the circle
  • Point Q
−20246−6−4−2024xyM
Point Q
(4, 2)
Substitute
(4 − 2)² + (2 + 1)² = 4 + 9 = 13
Compare
13 = 13: on the circle
Grid points found
1 of 8
Substitute Q and compare the result with r² = 13.
Show the numbers
Point Q(x − 2)² + (y + 1)²Position
(4, 2)13on the circle
(3, 0)2inside the circle
(6, 1)20outside the circle
(0, −4)13on the circle
(−2, −1)16outside the circle

Completing the square

Sometimes the equation comes without brackets:

x² + y² − 4x + 2y − 8 = 0

You cannot read M and r off this directly. First you put the equation back in the form with brackets. This is called completing the square.

You can see the idea in a square with side x. Its area is x². Take away a strip 2 wide on the right. Take away a strip 2 wide along the top as well. Together that is 4x. You have now taken away the 2 by 2 corner twice. Put it back once. A square with side x − 2 is left.

Completing the square with areas
  • Square (x − 2)²
  • Strips 2 wide, 4x together
  • 2 by 2 corner, taken away twice
(x − 2)²x − 2 = 4224
x² − 4x + 4
36 − 24 + 4 = 16
(x − 2)²
4² = 16
So
x² − 4x + 4 = (x − 2)²
Take off two strips of 2, put the 2 by 2 corner back once. What is left is (x − 2)².
Show the numbers
xx²4xx² − 4x + 4(x − 2)²
4161644
5252099
636241616
749282525
864323636
981364949
10100406464

x² − 4x + 4 = (x − 2)²

So x² − 4x = (x − 2)² − 4. The rule: take half the number next to x. That goes inside the brackets. Then subtract its square. It works the same way for y. Half of 2 is 1.

x² − 4x = (x − 2)² − 4
y² + 2y = (y + 1)² − 1

Put this into the equation:

(x − 2)² − 4 + (y + 1)² − 1 − 8 = 0
(x − 2)² + (y + 1)² − 13 = 0
(x − 2)² + (y + 1)² = 13

The centre is M(2, −1) and the radius is √13. That is the same circle as above. If a negative number ends up on the right, there is no circle.

Complete the square: x² + y² + 6x − 8y = 0. What are the centre and radius?

Show the answer

x² + 6x = (x + 3)² − 9 and y² − 8y = (y − 4)² − 16. Substituting gives (x + 3)² − 9 + (y − 4)² − 16 = 0, so (x + 3)² + (y − 4)² = 25. The centre is M(−3, 4) and the radius is 5. The circle passes through the origin, because (0 + 3)² + (0 − 4)² = 9 + 16 = 25.

A line and a circle

A line and a circle share two points, one point or none. Take the circle x² + y² = 25. Its centre is the origin O(0, 0) and its radius is 5. Slide the line y = x + b up and down below.

Slide the line y = x + b

x² + y² = 25 and y = x + 1

  • Circle x² + y² = 25
  • Line y = x + b
  • Shared points
−8−6−4−202468−8−6−4−202468xy
Substituted
2x² + 2x − 24 = 0
Discriminant
D = 2² − 4 × 2 × (−24) = 4 + 192 = 196
Number of points
two intersection points
Shared points
(−4, −3) and (3, 4)
Two intersection points, one point of contact, or none. The discriminant shows which.
Show the numbers
bDNumber of points
−8−560
−5√2 ≈ −7.0701
−742
−6562
−51002
−41362
−31642
−21842
−11962
02002
11962
21842
31642
41362
51002
6562
742
5√2 ≈ 7.0701
8−560

Take the line y = x + 1. Replace y in the equation of the circle with x + 1:

x² + (x + 1)² = 25
x² + x² + 2x + 1 = 25
2x² + 2x − 24 = 0
x² + x − 12 = 0
(x + 4)(x − 3) = 0
x = −4 or x = 3

For x = 3, y = 3 + 1 = 4. For x = −4, y = −4 + 1 = −3. The intersection points are (3, 4) and (−4, −3).

Substituting always gives a quadratic equation. The discriminant D tells you how many solutions it has.

  • If D is positive, there are two intersection points.
  • If D is zero, there is one point. The line touches the circle and is called a tangent.
  • If D is negative, the line misses the circle.

For y = x + b, substituting gives 2x² + 2bx + b² − 25 = 0. Then D = 200 − 4b². D is zero when b² = 50, so at b = 5√2 ≈ 7.07 and at b = −5√2.

Where does the line y = x − 1 cut the circle x² + y² = 25?

Show the answer

x² + (x − 1)² = 25 gives 2x² − 2x + 1 = 25, so 2x² − 2x − 24 = 0 and x² − x − 12 = 0. That is (x − 4)(x + 3) = 0, so x = 4 or x = −3. The intersection points are (4, 3) and (−3, −4).

The tangent is perpendicular to the radius

A tangent touches the circle at one point P. The radius to P is always perpendicular to the tangent. Drag P around the circle below.

Drag the point of contact P
  • Circle x² + y² = 25
  • Radius OP
  • Tangent
−6−4−20246−6−4−20246xyOP
Point of contact P
(3, 4)
Slope of OP
4/3
Slope of the tangent
−3/4
Product
4/3 × (−3/4) = −1
Tangent
3x + 4y = 25
The radius OP and the tangent are perpendicular. The product of their slopes is −1.
Show the numbers
Point of contact PSlope of OPSlope of the tangentTangent
(−4, −3)3/4−4/3−4x − 3y = 25
(−3, −4)4/3−3/4−3x − 4y = 25
(0, −5)undefined, the line is vertical0y = −5
(3, −4)−4/33/43x − 4y = 25
(4, −3)−3/44/34x − 3y = 25
(5, 0)0undefined, the line is verticalx = 5
(4, 3)3/4−4/34x + 3y = 25
(3, 4)4/3−3/43x + 4y = 25
(0, 5)undefined, the line is vertical0y = 5
(−3, 4)−4/33/4−3x + 4y = 25
(−4, 3)−3/44/3−4x + 3y = 25
(−5, 0)0undefined, the line is verticalx = −5

Two lines are perpendicular when the product of their slopes is −1. With that you find the tangent to x² + y² = 25 at P(3, 4).

slope of OP = 43
slope of the tangent = −34, because 43 × −34 = −1

The tangent is y = −34x + c. Substitute P(3, 4) to find c:

4 = −34 × 3 + c = −94 + c
c = 4 + 94 = 254

Multiply y = −34x + 254 by 4. You get 4y = −3x + 25, which is 3x + 4y = 25.

Check it with the discriminant. Substituting into the circle gives x² − 6x + 9 = 0. Then D = 36 − 36 = 0. There is exactly one shared point: (3, 4).

At P(5, 0) the radius is horizontal. The tangent is then vertical: x = 5. A vertical line has no slope.

Read next

  • Powers and roots

    Powers and roots: the rules

    What a power is, the four rules, negative exponents and how to simplify √72. With figures you can slide and count.

  • Solving equations

    Solving equations: balance and graph

    Solve equations with the balance method, through brackets and fractions, with two crossing lines and with x², from factorising to the quadratic formula.

  • Pythagoras' theorem

    Pythagoras in the plane and in space

    Why a² + b² = c² is true, how to work out a side, how to check for a right angle, and how to find distances and space diagonals.