Coordinate Geometry

Coordinate Geometry

Straight lines: gradient, length, midpoint and equations

Formulas and Gradient AS Level 15 min read

On this page
  1. What you need to be able to do
  2. What you should already know
  3. Gradient, length and midpoint
  4. The equation of a straight line
  5. Parallel and perpendicular lines
  6. Gradient and angle
  7. Case by case
  8. Key facts at a glance
  9. How this is examined
  10. Mark-scheme focus
  11. Worked examples
  12. Summary
  13. Can I do this?
  14. Quiz

What you need to be able to do

Syllabus 1.3 Coordinate geometry
  • 1.3Find the gradient, length and midpoint of a line segment, and the point where two lines meet.
  • 1.3Find the equation of a line from two points, or from a point and a gradient, and use the forms \(y=mx+c\), \(y-y_1=m(x-x_1)\), \(ax+by+c=0\).
  • 1.3Use parallel (equal gradients) and perpendicular (\(m_1m_2=-1\)) lines, and the link between gradient and angle.

Next: Perpendicular bisectors and coordinate problems. These tools turn up in tangents and normals (Differentiation) and circles.

Part 1Learn the topic

Gradient, distance, midpoint and the equation of a line, from the basics, with our own examples. Past-paper questions come in Part 2.

What you should already know

Coordinates

\((x,\,y)\): across first, then up. Points on the \(x\)-axis have \(y=0\); points on the \(y\)-axis have \(x=0\).

Quick check: where does \(y=2x-6\) cross the \(x\)-axis?

\(0=2x-6\): at \((3,\,0)\)

Pythagoras

In a right-angled triangle, \(c^2=a^2+b^2\) with \(c\) the hypotenuse. Sides 6 and 8 give \(c=10\).

Quick check: hypotenuse of a triangle with sides 5 and 12?

\(\sqrt{169}=13\)

Rearranging a linear equation

\(3x+2y=12\Rightarrow2y=12-3x\Rightarrow y=6-\tfrac32x\).

Quick check: write \(4x-5y=10\) as \(y=\dots\)

\(y=\tfrac45x-2\)

Tangent in a right-angled triangle

\(\tan\theta=\dfrac{\text{opposite}}{\text{adjacent}}\). A slope that rises 3 for every 3 across makes \(45°\).

Quick check: angle whose tangent is 1?

\(45°\)

Gradient, length and midpoint

xyOA(x₁, y₁)B(x₂, y₂)Mx₂ − x₁y₂ − y₁length AB
One right-angled triangle gives all three formulas.
  1. Gradient = rise ÷ run: \(m=\dfrac{y_2-y_1}{x_2-x_1}\). Keep the same order top and bottom (B − A over B − A).
  2. Length (Pythagoras on the triangle): \(AB=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\).
  3. Midpoint = the average of the coordinates: \(M=\left(\dfrac{x_1+x_2}{2},\ \dfrac{y_1+y_2}{2}\right)\).
  4. Intersection of two lines: solve their equations simultaneously.

What gradient means. Gradient is the steepness: how far the line rises for each 1 unit across. Gradient 3 climbs 3 for every 1 to the right; gradient \(-\tfrac12\) falls half a unit for every 1 to the right; gradient 0 is flat. A line has the same gradient everywhere, which is why any two of its points give the same answer.

Example. \(A(1,\,2)\) and \(B(7,\,10)\). Gradient \(=\dfrac{10-2}{7-1}=\dfrac86=\dfrac43\). Length \(=\sqrt{6^2+8^2}=\sqrt{100}=10\). Midpoint \(=\left(\dfrac{1+7}2,\ \dfrac{2+10}2\right)=(4,\,6)\).

None of these is on the formula list. A sketch with the triangle drawn on makes all three obvious. Sketch first, then calculate.
Try it yourself
  1. \(P(-3,\,5)\), \(Q(1,\,-3)\). Find the gradient, length and midpoint of \(PQ\).
    Answer\(m=\tfrac{-8}4=-2\); \(\sqrt{16+64}=\sqrt{80}=4\sqrt5\); \((-1,\,1)\)
  2. The midpoint of \(A(2,\,k)\) and \(B(m,\,7)\) is \((5,\,4)\). Find \(k\) and \(m\).
    Answer\(\tfrac{2+m}2=5\Rightarrow m=8\); \(\tfrac{k+7}2=4\Rightarrow k=1\)

The equation of a straight line

FormUse it whenExample
\(y-y_1=m(x-x_1)\)you know a point and the gradient (the fastest route)through \((3,4)\), \(m=-\tfrac43\): \(y-4=-\tfrac43(x-3)\)
\(y=mx+c\)you want to read off the gradient and y-intercept\(y=-\tfrac43x+8\)
\(ax+by+c=0\)the question asks for it ("integers")\(4x+3y-24=0\)
  1. From two points: gradient first, then \(y-y_1=m(x-x_1)\) with either point.
  2. To \(ax+by+c=0\) with integers: multiply out, clear fractions (×3 here), collect every term on one side. Any whole-number multiple is the same line.
  3. Gradient from \(ax+by+c=0\): rearrange to \(y=\dots\): \(m=-\tfrac ab\). E.g. \(\tfrac x3+\tfrac y2=1\Rightarrow y=2-\tfrac23x\), \(m=-\tfrac23\).
  4. Where a line meets the axes: put \(x=0\) (y-intercept) or \(y=0\) (x-intercept).

Where the point-gradient form comes from. Take any point \((x,\,y)\) on the line through \((x_1,\,y_1)\) with gradient \(m\). The gradient between the two points is \(m\): \(\dfrac{y-y_1}{x-x_1}=m\). Multiply up and you have \(y-y_1=m(x-x_1)\).

Try it yourself
  1. Find the equation of the line through \((2,\,-1)\) and \((6,\,7)\).
    Answer\(m=2\): \(y+1=2(x-2)\), i.e. \(y=2x-5\)
  2. Write the line through \((-3,\,4)\) with gradient \(-\tfrac23\) in the form \(ax+by+c=0\).
    Answer\(y-4=-\tfrac23(x+3)\Rightarrow3y-12=-2x-6\Rightarrow2x+3y-6=0\)

Parallel and perpendicular lines

xyO21m₁ = ½m₂ = −2
Rotating a gradient triangle by 90° turns \(\tfrac{\text{rise}}{\text{run}}\) into \(-\tfrac{\text{run}}{\text{rise}}\).
  1. Parallel lines have equal gradients.
  2. Perpendicular lines: \(m_1\times m_2=-1\), so \(m_2=-\dfrac{1}{m_1}\) (flip and change sign): \(\tfrac34\to-\tfrac43\); \(-2\to\tfrac12\).
  3. Horizontal (\(m=0\)) and vertical (\(x=k\)) lines are perpendicular too: the formula can't handle them, a sketch can.
  4. To show an angle is a right angle: \(m_1m_2=-1\), or Pythagoras on the three lengths. Both are accepted.
Try it yourself
  1. Find the line through \((1,\,3)\) perpendicular to \(y=4x-1\).
    Answer\(m=-\tfrac14\): \(y-3=-\tfrac14(x-1)\)
  2. Are \(2x+3y=5\) and \(3x-2y=1\) perpendicular?
    Answergradients \(-\tfrac23\) and \(\tfrac32\); product \(-1\): yes

Gradient and angle

xyOθgradient m = tan θ
\(m=\tan\theta\), \(\theta\) measured from the positive \(x\)-direction.
  1. A line making angle \(\theta\) with the positive \(x\)-axis has gradient \(m=\tan\theta\). (\(\theta=45°\Rightarrow m=1\).)
  2. Angle between two lines with gradients \(m_1>m_2>0\): \(\tan^{-1}m_1-\tan^{-1}m_2\). Gradients 2 and \(\tfrac13\): \(63.43°-18.43°=45°\).
  3. Exact lengths from an angle: a line through \(B(0,3)\) meets the \(x\)-axis at \(A\) with angle \(BAO=\tfrac\pi3\) ⇒ \(\tan\tfrac\pi3=\tfrac{3}{OA}\Rightarrow OA=\tfrac{3}{\sqrt3}=\sqrt3\), and \(m_{AB}=-\sqrt3\).

Case by case

1 Midpoint, then a parallel line

\(M\) is the midpoint of \((5,1)\) and \((-1,7)\). Find the line through \(M\) parallel to \(\tfrac x4+\tfrac y2=1\).

AskedequationKnowparallel: same gradient as the given lineRoutemidpoint, gradient from the given line, point-gradient form

  1. \(M=\left(\tfrac{5-1}{2},\ \tfrac{1+7}{2}\right)=(2,4)\)
  2. \(\tfrac x4+\tfrac y2=1\Rightarrow y=2-\tfrac12x\): \(m=-\tfrac12\)
  3. \(y-4=-\tfrac12(x-2)\), i.e. \(x+2y=10\)

2 A perpendicular line and where it meets the axis

\(A(-2,-1)\), \(B(4,3)\). \(BC\perp AB\) meets the \(x\)-axis at \(C\). Find \(C\) and the length \(AC\).

AskedBC, C and ACKnow\(m_{AB}=\tfrac{4}{6}=\tfrac23\)Routeperpendicular gradient −3/2 through B, then y = 0

  1. \(m_{BC}=-\tfrac32\): \(y-3=-\tfrac32(x-4)\)
  2. \(y=0\): \(-3=-\tfrac32(x-4)\Rightarrow x=6\), \(C(6,0)\)
  3. \(AC=\sqrt{8^2+1^2}=\sqrt{65}=8.062\) (3 d.p.)

3 Letters for coordinates

\(A(4a,a)\), \(B(-a,-11a)\), \(a>0\). Find the line through \(O\) parallel to \(AB\), and \(a\) if \(AB=6\tfrac12\).

Askedthe line and aKnoweverything in terms of aRoutethe a's cancel in the gradient; Pythagoras for the length

  1. \(m_{AB}=\dfrac{-11a-a}{-a-4a}=\dfrac{-12a}{-5a}=\tfrac{12}5\): \(y=\tfrac{12}5x\)
  2. \(AB^2=(5a)^2+(12a)^2=169a^2\Rightarrow AB=13a=\tfrac{13}2\)
  3. \(a=\tfrac12\) (\(a>0\))

The a's cancel, so the gradient is a plain number and the line's equation must not contain a.

4 Area of a triangle with the axes

The line with gradient \(-3\) through \(P(2t,3t)\) meets the axes at \(A\) and \(B\). Find the area of triangle \(AOB\).

Askedarea in terms of tKnowa right-angled triangle at ORoutefind both intercepts, then ½ × base × height

  1. \(y-3t=-3(x-2t)\)
  2. \(x=0\Rightarrow y=9t\); \(y=0\Rightarrow x=3t\)
  3. Area \(=\tfrac12(3t)(9t)=\tfrac{27}2t^2\)
Try it yourself
  1. Find where \(y=2x+1\) and \(x+y=7\) meet.
    Answer\(x+2x+1=7\Rightarrow x=2\): \((2,\,5)\)
  2. A line makes \(60°\) with the positive \(x\)-axis and passes through the origin. Find its equation.
    Answer\(m=\tan60°=\sqrt3\): \(y=\sqrt3x\)

Key facts at a glance

  • Gradient \(\dfrac{y_2-y_1}{x_2-x_1}\); length \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\); midpoint = average of the coordinates.
  • Line through \((x_1,y_1)\) with gradient \(m\): \(y-y_1=m(x-x_1)\).
  • Parallel: equal gradients. Perpendicular: \(m_1m_2=-1\).
  • \(m=\tan\theta\) from the positive \(x\)-direction. Lines meet where their equations are solved together.
  • Sketch first: none of these formulas is given in the exam.
Part 2Past-paper questions, step by step

How straight-line work is examined, what the mark scheme wants, then real Paper 1 questions worked through slowly.

How this is examined

Straight-line work is in nearly every Paper 1 coordinate geometry question, usually as the first step of a longer problem. The June 2021 report: "the use of a diagram for coordinate geometry questions is always recommended". For an answer "in the form \(ax+by+c=0\)" schemes want "all correct terms on one side ... allow multiples of this format by an integer only", and an equation that should be numeric "must not include a".

Mark-scheme focus

Give the equation in the form ax + by + c = 0 (integers)

9709/12/O/N/23 Q11Paper 1 · Pure Mathematics 1Part (c)3 marksFull size
(c) Find the equation of the tangent to the circle at C, giving the answer in the form dx + ey + f = 0, where d, e and f are integers. [3]
Credited
  • \(4x+7y-182=0\): "all terms on one side in any order"; "allow multiples of this format by an integer only" A1
Not credited
  • \(y-18=-\tfrac47(x-14)\) left as it is ("correct equation but not stated in the required form")
  • \(\tfrac47x+y-26=0\) (fractions)
  • \(7y=-4x+182\) (not \(=0\))
Why

The method marks are for the gradient and the point; the final A1 is only for the requested form.

From: 9709/12/O/N/23 Q11(c); 9709/13/M/J/25 Q9(b).

  • Straight-line skills inside other questions: tangents/normals (Differentiation), perpendicular bisectors, circles - on every paper.
  • Pure straight-line questions (common before 2020, rarer now): 4-7 marks, B1 for gradient, M1 for m₁m₂ = −1, M1 for the line, A1.
  • Form of the answer: read it (y = mx + c, ax + by + c = 0 with integers, or "exact").

Worked examples

Example 1 · Midpoint and a parallel line (Paper 1, 4 marks) ★ Easy
9709/12/O/N/19 Q2Paper 1 · Pure Mathematics 14 marksFull size
The point M is the mid-point of the line joining the points (3, 7) and (−1, 1). Find the equation of the line through M which is parallel to the line x/3 + y/2 = 1. [4]
1 Read it with me what is actually happening?

Two small jobs joined together: find the point \(M\) (average the coordinates), find the gradient (rearrange the given line), then write the line through \(M\).

  • mid-pointaverage the x's, average the y's
  • parallelsame gradient as the given line
2 What is it asking for? the target, part by part
  • equation of the line4 marks
3 What do we know? everything the question gives us
  • \((3,7)\), \((-1,1)\)ends
  • \(\tfrac x3+\tfrac y2=1\)parallel to this
4 Plan the route work backwards from what we want
FindMaths ideaAlready have itWork out firstTrap
  • Findthe line
    • Point\(M=(1,4)\)
    • Gradientrearrange: \(y=2-\tfrac23x\)
What is the gradient of x/3 + y/2 = 1?

Multiply by 6: \(2x+3y=6\Rightarrow y=-\tfrac23x+2\): \(-\tfrac23\).

Which form is quickest to finish with?

\(y-y_1=m(x-x_1)\): \(y-4=-\tfrac23(x-1)\).

5 Now solve it have a go on paper first, then open the worked solution
  1. \(M=(1,4)\) M1 A1
  2. gradient \(-\tfrac23\) M1
  3. \(y-4=-\tfrac23(x-1)\) (any equivalent) A1
6 Check it does the answer make sense?

\(M\) satisfies it ✓; the gradient matches \(2x+3y=6\) ✓.

Example 2 · Perpendicular line, an intercept and a distance (Paper 1, 6 marks) ★ Easy
9709/13/O/N/18 Q4Paper 1 · Pure Mathematics 16 marksFull size
Two points A and B have coordinates (−1, 1) and (3, 4) respectively. The line BC is perpendicular to AB and intersects the x-axis at C. (i) Find the equation of BC and the x-coordinate of C. [4] (ii) Find the distance AC, giving your answer correct to 3 decimal places. [2]
1 Read it with me what is actually happening?

Sketch \(A\), \(B\) and a line through \(B\) at right angles to \(AB\), sloping down to the \(x\)-axis. The gradient of \(AB\) flips to give the gradient of \(BC\).

  • perpendicular\(m_{BC}=-\dfrac{1}{m_{AB}}\)
  • intersects the x-axisy = 0
  • 3 decimal placesAC = 7.071, not 7.07
2 What is it asking for? the target, part by part
  • (i)BC and C4
  • (ii)AC2
3 What do we know? everything the question gives us
  • \(A(-1,1)\)
  • \(B(3,4)\)
4 Plan the route work backwards from what we want
FindMaths ideaAlready have itWork out firstTrap
  • (i)BC
    • m\(m_{AB}=\tfrac34\Rightarrow m_{BC}=-\tfrac43\)
    • Usethrough B (not A!)
  • (ii)AC
    • Usedistance formula
Why through B and not A?

The line is BC: it starts at B.

Solve 0 − 4 = −4/3(x − 3).

\(x-3=3\Rightarrow x=6\).

5 Now solve it have a go on paper first, then open the worked solution
  1. \(m_{AB}=\tfrac{4-1}{3+1}=\tfrac34\) B1
  2. \(BC\): \(y-4=-\tfrac43(x-3)\) M1 A1
  3. \(y=0\Rightarrow x=6\) A1
  4. (ii) \(AC^2=(6+1)^2+(0-1)^2=50\) M1 \(\Rightarrow AC=7.071\) A1
6 Check it does the answer make sense?

\(m_{AB}\times m_{BC}=\tfrac34\times(-\tfrac43)=-1\) ✓; C is right of B, as the sketch shows ✓.

Example 3 · Coordinates in terms of a (Paper 1, 5 marks) ★★ Medium
9709/11/O/N/18 Q3Paper 1 · Pure Mathematics 15 marksFull size
Two points A and B have coordinates (3a, −a) and (−a, 2a) respectively, where a is a positive constant. (i) Find the equation of the line through the origin parallel to AB. [2] (ii) The length of the line AB is 3⅓ units. Find the value of a. [3]
1 Read it with me what is actually happening?

The coordinates contain \(a\), but the method is the usual one. In the gradient the \(a\)'s cancel. In the length you get \(a^2\), which you solve.

  • through the originc = 0: \(y=mx\)
  • a is a positive constantreject the negative root
2 What is it asking for? the target, part by part
  • (i)the line2
  • (ii)a3
3 What do we know? everything the question gives us
  • \(A(3a,-a)\)
  • \(B(-a,2a)\)
  • \(AB=\tfrac{10}{3}\)
4 Plan the route work backwards from what we want
FindMaths ideaAlready have itWork out firstTrap
  • (i)line
    • Use\(m=\tfrac{3a}{-4a}\)
  • (ii)a
    • Use\(AB^2=(4a)^2+(3a)^2\)
Change in x from A to B?

\(-a-3a=-4a\).

25a² = 100/9 gives a = ?

\(a^2=\tfrac{4}{9}\), \(a=\tfrac23\).

5 Now solve it have a go on paper first, then open the worked solution
  1. (i) \(m=-\tfrac34\) B1; \(y=-\tfrac34x\) B1FT
  2. (ii) \((4a)^2+(3a)^2=\left(\tfrac{10}{3}\right)^2\) M1
  3. \(25a^2=\tfrac{100}{9}\) A1 \(\Rightarrow a=\tfrac23\) A1
6 Check it does the answer make sense?

With \(a=\tfrac23\): \(A(2,-\tfrac23)\), \(B(-\tfrac23,\tfrac43)\); \(AB=\sqrt{(\tfrac83)^2+2^2}=\sqrt{\tfrac{100}{9}}\) ✓.

Summary

  • \(m=\dfrac{y_2-y_1}{x_2-x_1}\); length by Pythagoras; midpoint = averages.
  • Line: \(y-y_1=m(x-x_1)\); convert to the form asked.
  • Parallel: equal \(m\). Perpendicular: \(m_1m_2=-1\).
  • \(m=\tan\theta\); angle between lines = difference of the \(\tan^{-1}\) values.
If you see…do this
"parallel to"same gradient
"perpendicular to"negative reciprocal
"meets the x-axis"y = 0
"in the form ax + by + c = 0"integers, all on one side
"angle the line makes"\(\tan\theta=m\)

Can I do this?

Anything unticked: revise that section first. All ticked: take the quiz.

Quiz

The multiple-choice and guided questions need JavaScript. The concept checks and exam practice below work without it.

Concept checks

Answer each one in your head first, then open it.

1Why does \(m_1m_2=-1\) fail for a horizontal and a vertical line?Show answer

A vertical line has no gradient (division by zero), but they are perpendicular. Use a sketch.

2Does it matter which point is \((x_1,y_1)\)?Show answer

No, as long as you take both coordinates from the same point, top and bottom.

3How can you check a line equation you've found?Show answer

Substitute the given point(s): they must satisfy it; and read off its gradient.

Exam-style practice

New questions, not used above. Do them on paper, then mark your work against the official mark scheme.

Q19709/12/F/M/18 Q4Paper 1 · Pure Mathematics 16 marksFull size
A straight line cuts the positive x-axis at A and the positive y-axis at B(0, 2). Angle BAO = π/6 radians. (i) Find the exact value of the x-coordinate of A. [2] (ii) Find the equation of the perpendicular bisector of AB, giving your answer in the form y = mx + c, where m is given exactly and c is an integer. [4]
Show the mark scheme
PartAnswer / workingMarksGuidance
(i)\(\tan\tfrac\pi6=\tfrac{2}{x}\)M1an exact value of \(\tan\tfrac\pi6\) is needed: \(\tfrac1{\sqrt3}\)
\(x=2\sqrt3\)A1
(ii)midpoint \((\sqrt3,\ 1)\)B1FThalf their (i)
\(m_{AB}=-\tfrac1{\sqrt3}\Rightarrow\) bisector gradient \(\sqrt3\)M1
\(y-1=\sqrt3(x-\sqrt3)\)DM1through the midpoint
\(y=\sqrt3x-2\)A1
Total: 6 marks
Q29709/12/M/J/16 Q8Paper 1 · Pure Mathematics 18 marksFull size
Three points have coordinates A(0, 7), B(8, 3) and C(3k, k). Find the value of the constant k for which (i) C lies on the line that passes through A and B, [4] (ii) C lies on the perpendicular bisector of AB. [4]
Show the mark scheme
PartAnswer / workingMarksGuidance
(i)\(m_{AB}=-\tfrac12\)B1
\(y=-\tfrac12x+7\)M1an equation from A or B
\(k=-\tfrac12(3k)+7\)M1C substituted
\(k=\tfrac{14}5\) (2.8)A1equal gradients \(m_{AC}=m_{AB}\) is also on the scheme
(ii)midpoint \(M(4,5)\)B1
perpendicular gradient \(2\)M1\(m_1m_2=-1\)
\(y-5=2(x-4)\) with \(x=3k,\ y=k\)M1
\(k=\tfrac35\)A1or from \(AC^2=BC^2\): \(40k=24\)
Total: 8 marks

Examiner tip Two different conditions on one point: (i) on a line means substitute into its equation; (ii) on the perpendicular bisector also means equally far from A and B, which is the quicker Pythagoras route.

Your progress on this note is saved when JavaScript is on.