Lemma
← All topics
Pure mathematics

Straight lines and circles

Geometry you can calculate.

Introduction

Coordinate geometry turns shapes into equations. A line becomes y=mx+cy = mx + c, a circle becomes (x−a)2+(y−b)2=r2(x - a)^2 + (y - b)^2 = r^2, and questions like "do these meet?" or "is this a right angle?" become algebra. This topic covers gradients, the equations of lines, parallel and perpendicular lines, the equation of a circle, and the circle theorems that A level uses: tangents, chords and the angle in a semicircle.

Why it matters

Every computer game, GPS and CAD package works with coordinates. Deciding whether a ray hits an object is solving a line with a curve; drawing a smooth tangent uses perpendicular gradients. The methods here are also the base for vectors, parametric equations and calculus.

Intuitive explanation

IntuitionGradient is "up per along"

A gradient of 33 means every step of 1 to the right goes up 3. A perpendicular line turns this by 90°90°: "3 up, 1 along" becomes "1 up, 3 back", a gradient of −13-\frac13. That is why perpendicular gradients multiply to −1-1.

IntuitionA circle is Pythagoras

A point (x,y)(x, y) is on the circle with centre (a,b)(a, b) and radius rr exactly when its distance from the centre is rr. Pythagoras on the horizontal and vertical gaps gives (x−a)2+(y−b)2=r2(x - a)^2 + (y - b)^2 = r^2.

Formal definitions

DefinitionGradient

The gradient of the line through (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1}.

DefinitionForms of a straight line
  • y=mx+cy = mx + c: gradient mm, yy-intercept cc
  • y−y1=m(x−x1)y - y_1 = m(x - x_1): gradient mm through (x1,y1)(x_1, y_1)
  • ax+by+c=0ax + by + c = 0: general form, often asked with integer a,b,ca, b, c
DefinitionCircle

The circle with centre (a,b)(a, b) and radius rr is (x−a)2+(y−b)2=r2(x - a)^2 + (y - b)^2 = r^2.

Notation

  • Midpoint of (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2): (x1+x22,y1+y22)\left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right).
  • Distance: (x2−x1)2+(y2−y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
  • l1∥l2l_1 \parallel l_2: parallel; l1⊥l2l_1 \perp l_2: perpendicular.

Key facts

IdentitiesLines
  • Parallel lines: m1=m2m_1 = m_2.
  • Perpendicular lines: m1m2=−1m_1 m_2 = -1, i.e. m2=−1m1m_2 = -\dfrac{1}{m_1}.
IdentitiesCircle theorems used at A level
  • The angle in a semicircle is a right angle.
  • The perpendicular from the centre to a chord bisects the chord.
  • A tangent is perpendicular to the radius at the point of contact.

Key results

TheoremExpanded form of a circle

x2+y2+2fx+2gy+c=0x^2 + y^2 + 2fx + 2gy + c = 0 is a circle with centre (−f,−g)(-f, -g) and radius f2+g2−c\sqrt{f^2 + g^2 - c}, provided f2+g2−c>0f^2 + g^2 - c > 0.

PropositionLine and circle

Substitute the line into the circle to get a quadratic. Discriminant >0> 0: two intersections (a chord). =0= 0: one (a tangent). <0< 0: none.

Proofs

ProofPerpendicular gradients multiply to −1-1

A line of gradient mm has direction "1 along, mm up", the vector (1m)\binom{1}{m}. Rotating by 90°90° gives (−m1)\binom{-m}{1}, gradient 1−m\frac{1}{-m}. So the perpendicular gradient is −1m-\frac1m and the product is −1-1.

∎
ProofCentre of the expanded circle

Complete the square: x2+2fx=(x+f)2−f2x^2 + 2fx = (x + f)^2 - f^2 and y2+2gy=(y+g)2−g2y^2 + 2gy = (y + g)^2 - g^2. So the equation becomes (x+f)2+(y+g)2=f2+g2−c(x + f)^2 + (y + g)^2 = f^2 + g^2 - c.

∎

The distance from a point to a line

TheoremPerpendicular distance

The distance from P(x0,y0)P(x_0, y_0) to the line ax+by+c=0ax + by + c = 0 is

d=∣ax0+by0+c∣a2+b2.d = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}.
Proof

The vector n=(a,b)\mathbf n = (a, b) is perpendicular to the line: if Q1Q_1 and Q2Q_2 lie on it, then a(x1−x2)+b(y1−y2)=0a(x_1 - x_2) + b(y_1 - y_2) = 0. Pick any point QQ on the line. The distance from PP is the length of the projection of QP⃗\vec{QP} onto n\mathbf n:

d=∣QP⃗⋅n∣∣n∣=∣a(x0−xQ)+b(y0−yQ)∣a2+b2=∣ax0+by0+c∣a2+b2,d = \frac{|\vec{QP}\cdot\mathbf n|}{|\mathbf n|} = \frac{|a(x_0 - x_Q) + b(y_0 - y_Q)|}{\sqrt{a^2 + b^2}} = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}},

using axQ+byQ=−cax_Q + by_Q = -c.

∎

This one formula handles tangency (distance == radius), the gap between parallel lines and incircles, as the questions in this topic show.

Why perpendicular gradients multiply to −1

Rotating the direction vector (1,m)(1, m) through 90°90° gives (−m,1)(-m, 1), whose gradient is −1m-\frac1m. Equivalently, (1,m1)⋅(1,m2)=1+m1m2=0(1, m_1)\cdot(1, m_2) = 1 + m_1m_2 = 0. The dot product version also covers vertical lines, where gradients do not exist.

Methods

MethodEquation of a perpendicular bisector
  1. Find the midpoint of the segment.
  2. Find the gradient of the segment, then the negative reciprocal.
  3. Use y−y1=m(x−x1)y - y_1 = m(x - x_1) through the midpoint.
MethodTangent to a circle at a point
  1. Find the gradient of the radius from the centre to the point.
  2. The tangent gradient is the negative reciprocal.
  3. Write the line through the point.
MethodCircle through three points

The centre lies on the perpendicular bisector of every chord. Intersect two perpendicular bisectors to find it. If two of the points are ends of a diameter (a right angle at the third), the centre is simply their midpoint.

Examples

ExampleReading a circle

x2+y2−6x+4y−12=0x^2 + y^2 - 6x + 4y - 12 = 0. Complete the square: (x−3)2+(y+2)2=12+9+4=25(x - 3)^2 + (y + 2)^2 = 12 + 9 + 4 = 25. Centre (3,−2)(3, -2), radius 55.

See the Worked examples tab for tangents, chords and intersections, step by step.

Common mistakes

Common mistakeSigns in the centre

(x+3)2+(y−1)2=16(x + 3)^2 + (y - 1)^2 = 16 has centre (−3,1)(-3, 1), not (3,−1)(3, -1).

Common mistakeForgetting to square-root

(x−a)2+(y−b)2=20(x - a)^2 + (y - b)^2 = 20 has radius 20=25\sqrt{20} = 2\sqrt5, not 2020.

Common mistakeInteger form

When asked for ax+by+c=0ax + by + c = 0 "where a,b,ca, b, c are integers", clear all fractions.

Common mistakeWrong point for the perpendicular bisector

It passes through the midpoint, not one of the endpoints.

Applications

  • Navigation: the set of positions at a fixed distance from a transmitter is a circle; GPS intersects several.
  • Design: a tangent line joining a circular arc smoothly (railways, roads) must be perpendicular to the radius.
  • Collision detection: does a moving object's straight path hit a circular obstacle? Check the discriminant.

Connections

Summary

  • m=ΔyΔxm = \frac{\Delta y}{\Delta x}; y−y1=m(x−x1)y - y_1 = m(x - x_1).
  • Parallel: same gradient. Perpendicular: m1m2=−1m_1 m_2 = -1.
  • Circle: (x−a)2+(y−b)2=r2(x - a)^2 + (y - b)^2 = r^2; complete the square to read centre and radius.
  • Tangent ⊥\perp radius; perpendicular from centre bisects a chord; angle in a semicircle is 90°90°.
  • Line meets circle: substitute and use the discriminant.

Worked examples

Try each one yourself first, then open the solution.

Example 1Line through two points

Find the equation of the line through A(−1,5)A(-1, 5) and B(3,−3)B(3, -3) in the form ax+by+c=0ax + by + c = 0.

Show the solution
  1. 1Gradient

    m=−3−53−(−1)=−84=−2m = \dfrac{-3 - 5}{3 - (-1)} = \dfrac{-8}{4} = -2.

  2. 2Point-gradient form

    y−5=−2(x+1)y - 5 = -2(x + 1).

  3. 3Rearrange

    y−5=−2x−2⇒2x+y−3=0y - 5 = -2x - 2 \Rightarrow 2x + y - 3 = 0.

Answer

2x+y−3=02x + y - 3 = 0

Example 2Perpendicular bisector

Find the perpendicular bisector of P(2,1)P(2, 1) and Q(6,9)Q(6, 9).

Show the solution
  1. 1Midpoint

    (2+62,1+92)=(4,5)\left(\frac{2 + 6}{2}, \frac{1 + 9}{2}\right) = (4, 5).

  2. 2Gradient of PQPQ

    9−16−2=2\frac{9 - 1}{6 - 2} = 2, so the perpendicular gradient is −12-\frac12.

  3. 3Equation

    y−5=−12(x−4)⇒y=−12x+7y - 5 = -\tfrac12(x - 4) \Rightarrow y = -\tfrac12 x + 7, or x+2y−14=0x + 2y - 14 = 0.

Answer

x+2y−14=0x + 2y - 14 = 0

Example 3Centre and radius

Find the centre and radius of x2+y2+8x−2y−8=0x^2 + y^2 + 8x - 2y - 8 = 0.

Show the solution
  1. 1Group terms

    (x2+8x)+(y2−2y)=8(x^2 + 8x) + (y^2 - 2y) = 8.

  2. 2Complete both squares

    (x+4)2−16+(y−1)2−1=8(x + 4)^2 - 16 + (y - 1)^2 - 1 = 8.

  3. 3Tidy

    (x+4)2+(y−1)2=25(x + 4)^2 + (y - 1)^2 = 25.

Answer

Centre (−4,1)(-4, 1), radius 55

Example 4Tangent at a point

The circle (x−2)2+(y+1)2=25(x - 2)^2 + (y + 1)^2 = 25 passes through P(5,3)P(5, 3). Find the tangent at PP.

Show the solution
  1. 1Gradient of the radius

    Centre C(2,−1)C(2, -1): mCP=3−(−1)5−2=43m_{CP} = \dfrac{3 - (-1)}{5 - 2} = \dfrac43.

  2. 2Tangent gradient

    Perpendicular: −34-\dfrac34.

  3. 3Equation

    y−3=−34(x−5)⇒4y−12=−3x+15⇒3x+4y−27=0y - 3 = -\tfrac34(x - 5) \Rightarrow 4y - 12 = -3x + 15 \Rightarrow 3x + 4y - 27 = 0.

Answer

3x+4y−27=03x + 4y - 27 = 0

Example 5Does the line meet the circle?

Show that the line y=x+6y = x + 6 does not meet the circle x2+y2=16x^2 + y^2 = 16.

Show the solution
  1. 1Substitute

    x2+(x+6)2=16⇒2x2+12x+20=0⇒x2+6x+10=0x^2 + (x + 6)^2 = 16 \Rightarrow 2x^2 + 12x + 20 = 0 \Rightarrow x^2 + 6x + 10 = 0.

  2. 2Discriminant

    36−40=−4<036 - 40 = -4 < 0.

  3. 3Conclude

    No real solutions, so the line misses the circle.

Answer

Discriminant −4<0-4 < 0: no intersection.

Geometric check: the distance from the origin to the line is 62≈4.24>4\frac{6}{\sqrt2} \approx 4.24 > 4.

Example 6Circle from a diameter

A(1,2)A(1, 2) and B(7,10)B(7, 10) are the ends of a diameter. Find the equation of the circle.

Show the solution
  1. 1Centre is the midpoint

    (4,6)(4, 6).

  2. 2Radius

    12AB=1236+64=5\tfrac12 AB = \tfrac12\sqrt{36 + 64} = 5.

  3. 3Equation

    (x−4)2+(y−6)2=25(x - 4)^2 + (y - 6)^2 = 25.

Answer

(x−4)2+(y−6)2=25(x - 4)^2 + (y - 6)^2 = 25

Example 7A tangent from a parameter

Find the values of kk for which y=kxy = kx is a tangent to (x−5)2+y2=9(x - 5)^2 + y^2 = 9.

Show the solution
  1. 1Substitute

    (x−5)2+k2x2=9⇒(1+k2)x2−10x+16=0(x - 5)^2 + k^2x^2 = 9 \Rightarrow (1 + k^2)x^2 - 10x + 16 = 0.

  2. 2Tangent: discriminant zero

    100−64(1+k2)=0100 - 64(1 + k^2) = 0.

  3. 3Solve

    k2=3664⇒k=±34k^2 = \frac{36}{64} \Rightarrow k = \pm\frac34.

Answer

k=±34k = \pm\tfrac34

Beyond the specification

University-level ideas and the deeper mathematics behind this topic. Not needed for exams, but this is where the subject really opens up.

Power of a point, radical axes and inversion (university)

DefinitionPower of a point

For a circle with centre CC and radius rr, the power of a point PP is  pow⁡(P)=PC2−r2\ \operatorname{pow}(P) = PC^2 - r^2. If the circle is x2+y2+2gx+2fy+c=0x^2 + y^2 + 2gx + 2fy + c = 0, then pow⁡(x0,y0)\operatorname{pow}(x_0, y_0) is just the left-hand side evaluated at (x0,y0)(x_0, y_0).

TheoremIntersecting chords and secants

If a line through PP meets the circle at AA and BB, then  PA→⋅PB→=pow⁡(P)\ \overrightarrow{PA}\cdot\overrightarrow{PB} = \operatorname{pow}(P), whichever line is chosen. For a tangent, PT2=pow⁡(P)PT^2 = \operatorname{pow}(P).

Proof

Parametrise the line as P+tuP + t\mathbf u with ∣u∣=1|\mathbf u| = 1. Substituting into ∣X−C∣2=r2|X - C|^2 = r^2 gives t2+2t u⋅(P−C)+∣P−C∣2−r2=0t^2 + 2t\,\mathbf u\cdot(P - C) + |P - C|^2 - r^2 = 0. The roots tA,tBt_A, t_B have product ∣P−C∣2−r2|P - C|^2 - r^2 (Vieta), and PA→⋅PB→=tAtB\overrightarrow{PA}\cdot\overrightarrow{PB} = t_At_B.

∎

This unifies the GCSE circle theorems about intersecting chords, secants and tangents into one statement.

TheoremRadical axis

The points with equal power with respect to two non-concentric circles form a straight line, perpendicular to the line of centres. If the circles meet, it is the line through the intersection points.

Subtracting the two circle equations cancels x2+y2x^2 + y^2 and leaves exactly this line (question Q38). The three radical axes of three circles taken in pairs meet at one point, the radical centre.

Inversion

Inversion in the circle x2+y2=k2x^2 + y^2 = k^2 sends P≠OP \ne O to the point P′P' on ray OPOP with OP⋅OP′=k2OP\cdot OP' = k^2. In coordinates, (x,y)↦k2x2+y2(x,y)(x, y) \mapsto \frac{k^2}{x^2 + y^2}(x, y).

Theorem

Inversion maps circles and lines to circles and lines. A circle through OO becomes a line not through OO, and vice versa. Angles between curves are preserved.

Inversion turns problems about tangent circles into problems about parallel lines. It solves the problem of Apollonius (find circles tangent to three given circles) and Steiner's porism. In complex numbers it is z↦k2zˉz \mapsto \frac{k^2}{\bar z}, a relative of the Möbius maps met in Functions and graphs.

From circles to conics (university)

A circle is the set of points at a fixed distance from a centre. Changing the defining rule slightly gives the other conic sections, the curves made by slicing a cone with a plane.

DefinitionFocus–directrix definition

Fix a point FF (the focus), a line ℓ\ell (the directrix) and a number e>0e > 0 (the eccentricity). The conic is the set of points PP with PF=e⋅dist⁡(P,ℓ)PF = e\cdot\operatorname{dist}(P, \ell):

  • 0<e<10 < e < 1: an ellipse (a circle is the limit e→0e \to 0);
  • e=1e = 1: a parabola;
  • e>1e > 1: a hyperbola.

Every conic has an equation of degree 22:

Ax2+Bxy+Cy2+Dx+Ey+F=0.Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0.

Its type is decided by the discriminant B2−4ACB^2 - 4AC: negative for an ellipse (a circle when A=CA = C and B=0B = 0), zero for a parabola, positive for a hyperbola. Rotating the axes through an angle θ\theta with tan⁡2θ=BA−C\tan2\theta = \frac{B}{A - C} removes the xyxy term; this is diagonalising the symmetric matrix (AB/2B/2C)\begin{pmatrix} A & B/2 \\ B/2 & C\end{pmatrix}.

ExampleReflection properties
  • A light ray from one focus of an ellipse reflects off the curve through the other focus.
  • Rays parallel to the axis of a parabola reflect through its focus: hence satellite dishes and car headlights. Both follow from the trick in question Q55: reflect one point in the tangent line to turn a bent path into a straight one.

The Apollonius circle

Question Q46 found that {P:PA=kPB}\{P : PA = kPB\} is a circle when k≠1k \ne 1 (and the perpendicular bisector when k=1k = 1). In general its diameter runs between the points dividing ABAB internally and externally in the ratio k:1k : 1. This is the geometry behind the GPS-style problem of locating a source from the ratio of its distances to two receivers.

Lattice points: Pick’s theorem and the circle problem (university)

Pick's theorem

TheoremPick (1899)

For a polygon whose vertices all have integer coordinates, with II lattice points strictly inside and BB on the boundary,

Area=I+B2−1.\text{Area} = I + \frac B2 - 1.

For the triangle O(0,0)O(0, 0), A(4,1)A(4, 1), B(1,3)B(1, 3) of question Q39: the boundary has only the 33 vertices (each edge has gcd of coordinate differences equal to 11), and there are 55 interior points, so the area is 5+32−1=1125 + \frac32 - 1 = \frac{11}{2} ✓.

ProofIdea

Both sides are additive when two lattice polygons are glued along an edge (shared boundary points switch from BB to II in just the right way). Every lattice polygon can be cut into lattice triangles, and every lattice triangle sits inside a lattice rectangle minus right-angled triangles. So it is enough to check rectangles and right-angled triangles, which is direct counting.

∎

How many lattice points lie inside a circle?

Let N(r)N(r) count the integer points (m,n)(m, n) with m2+n2≤r2m^2 + n^2 \le r^2. Each point owns a unit square, so N(r)≈πr2N(r) \approx \pi r^2. Gauss showed that the error E(r)=N(r)−πr2E(r) = N(r) - \pi r^2 satisfies ∣E(r)∣≤Cr|E(r)| \le Cr. The true size of the error is a famous open problem (Gauss's circle problem): it is conjectured that ∣E(r)∣≤Cεr1/2+ε|E(r)| \le C_\varepsilon r^{1/2 + \varepsilon} for every ε>0\varepsilon > 0, and the best exponent proved so far is about 0.630.63.

The same count connects to number theory: the number of ways to write n=a2+b2n = a^2 + b^2 is 4(d1(n)−d3(n))4\big(d_1(n) - d_3(n)\big), where dk(n)d_k(n) counts the divisors of nn congruent to k mod 4k \bmod 4 (Jacobi). Summing this over n≤r2n \le r^2 gives Leibniz's series π4=1−13+15−⋯\frac\pi4 = 1 - \frac13 + \frac15 - \cdots.

Why does this work?

Why does this work?Why is the angle in a semicircle a right angle?

Let the circle have centre OO, diameter ABAB and a point CC on the circle. OA=OB=OCOA = OB = OC, so triangles OACOAC and OBCOBC are isosceles. If their base angles are α\alpha and β\beta, the angles of triangle ABCABC add to 2α+2β=180°2\alpha + 2\beta = 180°, so ∠ACB=α+β=90°\angle ACB = \alpha + \beta = 90°.

Beyond the syllabus

Beyond the syllabusConic sections

Circles, ellipses, parabolas and hyperbolas are all slices of a double cone, and all have equations of the form ax2+bxy+cy2+dx+ey+f=0ax^2 + bxy + cy^2 + dx + ey + f = 0. The sign of b2−4acb^2 - 4ac decides the type: negative for an ellipse, zero for a parabola, positive for a hyperbola. Each has a focus–directrix description: the set of points whose distance to a fixed point (focus) is ee times their distance to a fixed line, with eccentricity e<1e < 1, =1= 1 or >1> 1.

Beyond the syllabusProjective geometry

Parallel lines "meet at infinity" in the projective plane, where any two distinct lines meet in exactly one point. In this setting all non-degenerate conics are equivalent, and theorems such as Pascal's (opposite sides of a hexagon inscribed in a conic meet in three collinear points) take their natural form.

Mathematical curiosities

Mathematical curiosityDescartes' circle theorem

If four circles are mutually tangent with curvatures ki=±1rik_i = \pm\frac{1}{r_i}, then (k1+k2+k3+k4)2=2(k12+k22+k32+k42)(k_1 + k_2 + k_3 + k_4)^2 = 2(k_1^2 + k_2^2 + k_3^2 + k_4^2). Repeatedly filling gaps gives the Apollonian gasket, in which, starting from curvatures −1,2,2,3-1, 2, 2, 3, every curvature is an integer.

Further exploration

Further explorationInvestigations
  • Find the locus of points twice as far from (0,0)(0, 0) as from (3,0)(3, 0). (It is a circle: an Apollonius circle.)
  • Show that the reflective property of a parabola y=x2y = x^2 sends all vertical rays to the focus (0,14)\left(0, \frac14\right).
Now practise60 questions from Very easy to Extreme →