Length, gradient and midpoint

AS · P1 · 14 min

Coordinate geometry turns pictures into algebra: a point becomes a pair of numbers, and questions about lengths, slopes and positions become calculations. Three formulas, for the length of a line segment, its midpoint and its gradient, sit underneath every coordinate geometry question on Paper 1, from equations of lines to circles and tangents. This note builds each one from a picture, then shows how examiners combine them with unknown coordinates to make longer problems.

Coordinates and line segments

A point in the plane is written (x,y)(x, y): xx is the distance across from the yy-axis and yy the distance up from the xx-axis. Either can be negative.

A line segment ABAB is the straight piece of line between the points AA and BB. Its length is written ABAB or ∣AB∣|AB|. A line carries on for ever in both directions, so a line has a gradient but not a length.

Throughout this note, AA is the point (x1,y1)(x_1, y_1) and BB is the point (x2,y2)(x_2, y_2). The two numbers that drive every formula are

change in x=x2−x1,change in y=y2−y1\text{change in } x = x_2 - x_1, \qquad \text{change in } y = y_2 - y_1

Write these two differences down first in every question. Almost every error in this topic is a sign slip inside one of them.

The length of a line segment

Draw a horizontal line from AA and a vertical line from BB. They meet at a right angle, making a right-angled triangle with ABAB as the hypotenuse. The horizontal side has length x2−x1x_2 - x_1 and the vertical side y2−y1y_2 - y_1 (up to sign), so Pythagoras gives the length.

(1, 1) -- (6, 5) (1, 1) -- (6, 1) (6, 1) -- (6, 5) (1, 1) (6, 5)

In the figure, A(1,1)A(1, 1) and B(6,5)B(6, 5): the horizontal side is 55, the vertical side is 44, and AB=52+42=41AB = \sqrt{5^2 + 4^2} = \sqrt{41}.

Key result
AB=(x2−x1)2+(y2−y1)2AB = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

Because the differences are squared, it does not matter which point you call AA: (x2−x1)2=(x1−x2)2(x_2 - x_1)^2 = (x_1 - x_2)^2. It also does not matter if a difference is negative, since its square is positive.

Leave lengths as exact surds unless a decimal is asked for, and simplify them: 72=362=62\sqrt{72} = \sqrt{36}\sqrt{2} = 6\sqrt{2}. Later parts of a question often need AB2AB^2, which is a whole number, so keep that too.

The midpoint of a line segment

The midpoint is halfway across and halfway up, so each coordinate is the mean of the two end coordinates.

Key result
Midpoint of AB=(x1+x22, y1+y22)\text{Midpoint of } AB = \left(\frac{x_1 + x_2}{2},\ \frac{y_1 + y_2}{2}\right)

The same idea run backwards finds a missing endpoint. If MM is the midpoint of ABAB, then going from AA to MM is the same step as going from MM to BB. So

B=(2xM−x1, 2yM−y1)B = (2x_M - x_1,\ 2y_M - y_1)

You do not need to memorise this: just add the step from AA to MM on to MM again.

Dividing a segment in a given ratio

Sometimes a point PP lies on ABAB with AP:PB=1:2AP : PB = 1 : 2, say. Then PP is one third of the way from AA to BB. Take the step from AA to BB, multiply it by the fraction, and add it to AA:

P=(x1+13(x2−x1), y1+13(y2−y1))P = \left(x_1 + \tfrac{1}{3}(x_2 - x_1),\ y_1 + \tfrac{1}{3}(y_2 - y_1)\right)

For AP:PB=m:nAP : PB = m : n, the fraction is mm+n\dfrac{m}{m + n}. This is not a formula on the syllabus, but it comes up inside longer questions, and the "fraction of the step" idea is all you need.

Gradient

The gradient of a line measures how steep it is: how far it rises for each unit it moves to the right.

Definition

The gradient mm of the line through (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), with x1≠x2x_1 \neq x_2, is

m=y2−y1x2−x1=change in ychange in xm = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{change in } y}{\text{change in } x}

The order must match top and bottom: if you start the numerator from BB, start the denominator from BB too. Swapping both gives the same answer; swapping only one changes the sign.

GradientWhat the line does
m>0m > 0rises from left to right
m<0m < 0falls from left to right
m=0m = 0horizontal, equation y=ky = k
undefinedvertical, equation x=kx = k (the change in xx is zero)

If a line makes an angle θ\theta with the positive xx-axis, measured anticlockwise, then m=tan⁡θm = \tan\theta. A line at 45∘45^\circ has gradient 11; a line at 135∘135^\circ has gradient −1-1.

Collinear points

Three points AA, BB, CC are collinear if they lie on one straight line. Since they share the point BB, it is enough to show that the gradients of ABAB and BCBC are equal. Equal gradients alone would only make the segments parallel; the shared point is what puts them on the same line, so mention it.

Parallel and perpendicular lines

Parallel lines have the same steepness, so they have equal gradients.

For perpendicular lines, rotate a line through 90∘90^\circ. A step of (1,m)(1, m) along the line becomes a step of (−m,1)(-m, 1), which has gradient 1−m=−1m\dfrac{1}{-m} = -\dfrac{1}{m}. So the gradients multiply to −1-1.

Key result

For two lines with gradients m1m_1 and m2m_2 (neither vertical):

  • parallel   ⟺  m1=m2\iff m_1 = m_2
  • perpendicular   ⟺  m1m2=−1\iff m_1 m_2 = -1, that is, m2=−1m1m_2 = -\dfrac{1}{m_1}

To get a perpendicular gradient, flip the fraction and change its sign: 23\tfrac{2}{3} becomes −32-\tfrac{3}{2}; −4-4 becomes 14\tfrac{1}{4}.

y = (2/3)x + 1 y = (-3/2)x + 4 y = (2/3)x - 2

The two lines with gradient 23\tfrac{2}{3} are parallel; the line with gradient −32-\tfrac{3}{2} is perpendicular to both.

The rule fails for horizontal and vertical lines, because a vertical line has no gradient. Spot these by eye: a horizontal line (m=0m = 0) is perpendicular to any vertical line.

Using an unknown coordinate
  1. Write the unknown point with a letter, such as (k,5)(k, 5) or (t,2t)(t, 2t) if it lies on a known line.
  2. Translate the condition into an equation: a length, a midpoint, equal gradients, or a gradient product of −1-1.
  3. Simplify. Distance conditions are easier squared: use AB2AB^2, not ABAB.
  4. Solve, and keep every solution unless the question rules one out (for example "k>0k > 0").

Worked examples

Length and midpoint

The points AA and BB have coordinates (−3,7)(-3, 7) and (5,1)(5, 1). Find the length of ABAB and the coordinates of its midpoint.

Solution

Change in xx: 5−(−3)=85 - (-3) = 8. Change in yy: 1−7=−61 - 7 = -6.

AB=82+(−6)2=64+36=100=10AB = \sqrt{8^2 + (-6)^2} = \sqrt{64 + 36} = \sqrt{100} = 10Midpoint=(−3+52, 7+12)=(1, 4)\text{Midpoint} = \left(\frac{-3 + 5}{2},\ \frac{7 + 1}{2}\right) = (1,\ 4)
A missing endpoint

The midpoint of PQPQ is M(2,−1)M(2, -1). The point PP is (−4,3)(-4, 3). Find the coordinates of QQ.

Solution

The step from PP to MM is +6+6 in xx and −4-4 in yy. The same step from MM reaches QQ:

Q=(2+6, −1−4)=(8, −5)Q = (2 + 6,\ -1 - 4) = (8,\ -5)

Check: the midpoint of (−4,3)(-4, 3) and (8,−5)(8, -5) is (42,−22)=(2,−1)\left(\tfrac{4}{2}, \tfrac{-2}{2}\right) = (2, -1). Correct.

An unknown from a length

The distance between the points (k,3)(k, 3) and (2,−1)(2, -1) is 55. Find the possible values of kk.

Solution

Square the distance to avoid the square root:

(k−2)2+(3−(−1))2=25(k−2)2+16=25(k−2)2=9k−2=±3\begin{aligned} (k - 2)^2 + (3 - (-1))^2 &= 25 \\ (k - 2)^2 + 16 &= 25 \\ (k - 2)^2 &= 9 \\ k - 2 &= \pm 3 \end{aligned}

So k=5k = 5 or k=−1k = -1. Both are valid: the points (5,3)(5, 3) and (−1,3)(-1, 3) are both 55 units from (2,−1)(2, -1), one on each side.

Collinear points

(a) Show that A(−2,−5)A(-2, -5), B(1,1)B(1, 1) and C(4,7)C(4, 7) are collinear.

(b) The point D(k,13)D(k, 13) lies on the same line. Find kk.

Solution

(a)

mAB=1−(−5)1−(−2)=63=2,mBC=7−14−1=63=2m_{AB} = \frac{1 - (-5)}{1 - (-2)} = \frac{6}{3} = 2, \qquad m_{BC} = \frac{7 - 1}{4 - 1} = \frac{6}{3} = 2

ABAB and BCBC have the same gradient and share the point BB, so AA, BB and CC are collinear.

(b) BDBD must also have gradient 22:

13−1k−1=2⇒12=2k−2⇒k=7\frac{13 - 1}{k - 1} = 2 \quad\Rightarrow\quad 12 = 2k - 2 \quad\Rightarrow\quad k = 7
A right angle with an unknown

The points A(1,2)A(1, 2), B(5,k)B(5, k) and C(7,4)C(7, 4) are such that angle ABCABC is a right angle. Find the possible values of kk.

Solution

The right angle is at BB, so AB⊥BCAB \perp BC.

mAB=k−25−1=k−24,mBC=4−k7−5=4−k2m_{AB} = \frac{k - 2}{5 - 1} = \frac{k - 2}{4}, \qquad m_{BC} = \frac{4 - k}{7 - 5} = \frac{4 - k}{2}

Perpendicular means the product is −1-1:

k−24×4−k2=−1(k−2)(4−k)=−8−k2+6k−8=−8k2−6k=0k(k−6)=0\begin{aligned} \frac{k - 2}{4} \times \frac{4 - k}{2} &= -1 \\ (k - 2)(4 - k) &= -8 \\ -k^2 + 6k - 8 &= -8 \\ k^2 - 6k &= 0 \\ k(k - 6) &= 0 \end{aligned}

So k=0k = 0 or k=6k = 6. The points (5,0)(5, 0) and (5,6)(5, 6) both lie on the circle with diameter ACAC, which is why there are two answers (the angle in a semicircle is a right angle).

A point dividing a segment

The points A(−1,4)A(-1, 4) and B(8,−2)B(8, -2) are joined. The point PP lies on ABAB with AP:PB=2:1AP : PB = 2 : 1. Find the coordinates of PP.

Solution

PP is 23\tfrac{2}{3} of the way from AA to BB. The step from AA to BB is (9,−6)(9, -6), and 23\tfrac{2}{3} of it is (6,−4)(6, -4):

P=(−1+6, 4−4)=(5, 0)P = (-1 + 6,\ 4 - 4) = (5,\ 0)

Check: AP=36+16=52=213AP = \sqrt{36 + 16} = \sqrt{52} = 2\sqrt{13} and PB=9+4=13PB = \sqrt{9 + 4} = \sqrt{13}, in the ratio 2:12 : 1.

An equidistant point and an area

The points AA and BB have coordinates (2,1)(2, 1) and (6,5)(6, 5). The point CC lies on the yy-axis and is equidistant from AA and BB.

(a) Find the coordinates of CC.

(b) Find the area of triangle ABCABC.

Solution

(a) CC is on the yy-axis, so write C=(0,y)C = (0, y). Equidistant means AC2=BC2AC^2 = BC^2:

(0−2)2+(y−1)2=(0−6)2+(y−5)24+y2−2y+1=36+y2−10y+258y=56y=7\begin{aligned} (0 - 2)^2 + (y - 1)^2 &= (0 - 6)^2 + (y - 5)^2 \\ 4 + y^2 - 2y + 1 &= 36 + y^2 - 10y + 25 \\ 8y &= 56 \\ y &= 7 \end{aligned}

So C=(0,7)C = (0, 7).

(b) The triangle is isosceles with CA=CBCA = CB, so the line from CC to the midpoint MM of ABAB is perpendicular to ABAB and is the height.

M=(4,3)M = (4, 3). Then

AB=42+42=42,CM=42+(−4)2=42AB = \sqrt{4^2 + 4^2} = 4\sqrt{2}, \qquad CM = \sqrt{4^2 + (-4)^2} = 4\sqrt{2}

Check the right angle: mAB=44=1m_{AB} = \tfrac{4}{4} = 1 and mCM=3−74−0=−1m_{CM} = \tfrac{3 - 7}{4 - 0} = -1, product −1-1.

Area=12×42×42=16\text{Area} = \tfrac{1}{2} \times 4\sqrt{2} \times 4\sqrt{2} = 16
(2, 1) -- (6, 5) (6, 5) -- (0, 7) (0, 7) -- (2, 1) (0, 7) -- (4, 3) (4, 3)
Watch out

Mixing the order in the gradient. y2−y1x1−x2\dfrac{y_2 - y_1}{x_1 - x_2} gives the wrong sign. Keep the same point first on top and bottom.

Subtracting a negative. 5−(−3)=85 - (-3) = 8, not 22. Write the brackets in.

Perpendicular gradient with only one change. The perpendicular to m=23m = \tfrac{2}{3} is −32-\tfrac{3}{2}. Writing 32\tfrac{3}{2} (flip only) or −23-\tfrac{2}{3} (sign only) is a common lost mark.

Square-rooting too early. In "AC=BCAC = BC" problems, square both distances first; the y2y^2 terms then cancel and the equation is linear.

Using −1m-\tfrac{1}{m} with a vertical or horizontal line. A line with gradient 00 is perpendicular to a vertical line, which has no gradient at all. Recognise these from the coordinates.

Exam tip
  • Exact values. "Find the length" with no accuracy stated: give an exact surd in simplest form, or a decimal to 3 significant figures. A simplified surd is always safe.
  • Show your differences. Write 1−(−5)1−(−2)\dfrac{1 - (-5)}{1 - (-2)} before simplifying. If you slip, the method mark is still earned.
  • State the reason. For perpendicular lines, write "m1m2=−1m_1 m_2 = -1, so perpendicular". For collinear points, mention the shared point.
  • Multiple answers. Squaring creates two solutions. Give both unless the question restricts them, and say which one you reject and why.
  • Sketch. A rough sketch with the points plotted catches impossible answers, such as a midpoint that is not between the two points.
Summary
  • Length: AB=(x2−x1)2+(y2−y1)2AB = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}. Keep it exact and simplified.
  • Midpoint: average the coordinates. To find a missing endpoint, repeat the step from the known end to the midpoint.
  • A point a fraction λ\lambda of the way from AA to BB is A+λ(B−A)A + \lambda(B - A), coordinate by coordinate.
  • Gradient: m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1}; horizontal lines have m=0m = 0, vertical lines have no gradient.
  • Parallel: equal gradients. Perpendicular: m1m2=−1m_1 m_2 = -1.
  • Collinear: equal gradients and a shared point.
  • Conditions with unknown coordinates become equations; square distance conditions before solving.

Once you can find gradients and points, the next step is writing the equation of a line through them: see Equations of straight lines. Using these facts to identify shapes is covered in Proving properties of shapes.

Practice questions

Question
  1. Find the length of the line segment joining (−4,−1)(-4, -1) and (2,7)(2, 7), and the coordinates of its midpoint.
  2. The point (3,−2)(3, -2) is the midpoint of PQPQ, where PP is (7,5)(7, 5). Find QQ.
  3. Find the gradient of the line through (2,−3)(2, -3) and (6,5)(6, 5), and the gradient of a line perpendicular to it.
  4. The distance between the points (a,3)(a, 3) and (1,a)(1, a) is 10\sqrt{10}. Find the possible values of aa.
  5. The points (1,−1)(1, -1), (3,3)(3, 3) and (k,11)(k, 11) are collinear. Find kk.
  6. AA is (2,−3)(2, -3) and BB is (14,6)(14, 6). The point PP lies on ABAB with AP:PB=1:2AP : PB = 1 : 2. Find the coordinates of PP.
  7. The points A(−2,1)A(-2, 1), B(2,3)B(2, 3) and C(k,−5)C(k, -5) are such that angle ABC=90∘ABC = 90^\circ. Find kk.
  8. Find the point on the xx-axis that is equidistant from A(1,4)A(1, 4) and B(7,2)B(7, 2).
  9. The points A(1,3)A(1, 3), B(7,5)B(7, 5) and C(k,9)C(k, 9) form a triangle that is right-angled at AA. Find kk, show that the triangle is isosceles, and find its area.
  10. The point P(t,2t)P(t, 2t) is equidistant from A(−1,3)A(-1, 3) and B(5,1)B(5, 1). (a) Find tt. (b) MM is the midpoint of ABAB. Show that PMPM is perpendicular to ABAB, and find the exact length of PAPA.
Answers
  1. Differences 66 and 88, so the length is 36+64=10\sqrt{36 + 64} = 10. Midpoint (−4+22,−1+72)=(−1,3)\left(\tfrac{-4 + 2}{2}, \tfrac{-1 + 7}{2}\right) = (-1, 3).

  2. The step from PP to MM is (−4,−7)(-4, -7). Repeating it from MM: Q=(3−4,−2−7)=(−1,−9)Q = (3 - 4, -2 - 7) = (-1, -9).

  3. m=5−(−3)6−2=84=2m = \dfrac{5 - (-3)}{6 - 2} = \dfrac{8}{4} = 2. Perpendicular gradient −12-\tfrac{1}{2}.

  4. (1−a)2+(a−3)2=10(1 - a)^2 + (a - 3)^2 = 10, so a2−2a+1+a2−6a+9=10a^2 - 2a + 1 + a^2 - 6a + 9 = 10, giving 2a2−8a=02a^2 - 8a = 0, 2a(a−4)=02a(a - 4) = 0. So a=0a = 0 or a=4a = 4.

  5. The gradient of the first two points is 3−(−1)3−1=2\dfrac{3 - (-1)}{3 - 1} = 2. Then 11−3k−3=2\dfrac{11 - 3}{k - 3} = 2, so 8=2k−68 = 2k - 6 and k=7k = 7.

  6. PP is 13\tfrac{1}{3} of the way from AA to BB. The step is (12,9)(12, 9); a third of it is (4,3)(4, 3). So P=(6,0)P = (6, 0).

  7. mAB=3−12−(−2)=12m_{AB} = \dfrac{3 - 1}{2 - (-2)} = \dfrac{1}{2}, so mBC=−2m_{BC} = -2: −5−3k−2=−2\dfrac{-5 - 3}{k - 2} = -2, so −8=−2k+4-8 = -2k + 4 and k=6k = 6.

  8. Let the point be (x,0)(x, 0). (x−1)2+16=(x−7)2+4(x - 1)^2 + 16 = (x - 7)^2 + 4, so x2−2x+17=x2−14x+53x^2 - 2x + 17 = x^2 - 14x + 53, giving 12x=3612x = 36 and x=3x = 3. The point is (3,0)(3, 0). Check: both distances squared are 2020.

  9. mAB=26=13m_{AB} = \tfrac{2}{6} = \tfrac{1}{3}, so mAC=−3m_{AC} = -3: 9−3k−1=−3\dfrac{9 - 3}{k - 1} = -3, so 6=−3k+36 = -3k + 3 and k=−1k = -1. Then AB2=36+4=40AB^2 = 36 + 4 = 40 and AC2=4+36=40AC^2 = 4 + 36 = 40, so AB=AC=40AB = AC = \sqrt{40} and the triangle is isosceles. Area =12×AB×AC=12×40=20= \tfrac{1}{2} \times AB \times AC = \tfrac{1}{2} \times 40 = 20.

  10. (a) (t+1)2+(2t−3)2=(t−5)2+(2t−1)2(t + 1)^2 + (2t - 3)^2 = (t - 5)^2 + (2t - 1)^2. Expanding: 5t2−10t+10=5t2−14t+265t^2 - 10t + 10 = 5t^2 - 14t + 26, so 4t=164t = 16 and t=4t = 4. P=(4,8)P = (4, 8). (b) M=(2,2)M = (2, 2). mPM=8−24−2=3m_{PM} = \dfrac{8 - 2}{4 - 2} = 3 and mAB=1−35−(−1)=−13m_{AB} = \dfrac{1 - 3}{5 - (-1)} = -\dfrac{1}{3}. The product is −1-1, so PM⊥ABPM \perp AB. PA=(4+1)2+(8−3)2=50=52PA = \sqrt{(4 + 1)^2 + (8 - 3)^2} = \sqrt{50} = 5\sqrt{2}.

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action