Study Blocks

World map β€Ί Linear functions & gradient β€Ί Lesson 3

Gradient from two points

⏱ about 50 min · MYP criteria A, B, C, D

By the end of this lesson you can…
🌍 The big question

You are planning a bike ride. At the bottom of a long climb, a sign says β€œ8% hill”. Your map app shows two points on the road:

point on the roadhorizontal distance from the start (m)height above sea level (m)
bottom of the climb1500120
top of the climb4000320

You can’t stand back and draw a slope triangle 2.5 km long, and you can’t count grid squares on a mountain. Is the sign telling the truth?

Last lesson, gradient came from counting blocks. Today, all you get is two pairs of numbers. Guess first: is the hill gentler than 8%, about 8%, or steeper?

Every point on a graph has an address, its coordinates (x,y)(x, y). If you know the addresses of two points, you can find the rise and the run by subtracting instead of counting. That works for points far apart, points with negative coordinates, and points too far away to draw.

πŸ§ͺ Explore β€” try it, no scoring

Try these first. Nothing is marked: just have a go.

no hints, nothing is marked

On a park plan, measured in metres, a straight path runs from the point (20,15)(20, 15) to the point (60,35)(60, 35). The first number is the distance across and the second is the distance up the plan.

For each 1 m across, how many metres up does the path go?

m up per m across
no hints, nothing is marked

A straight line passes through (βˆ’4,3)(-4, 3) and (2,βˆ’6)(2, -6).

For each 1 unit you move to the right along the line, how far do you move up? (A move down counts as negative. A fraction is fine.)

🎯 Predict first

The line through A(1,1)A(1, 1) and B(4,3)B(4, 3) has gradient 23\frac{2}{3}. The point C(7,5)C(7, 5) is further along the same line. If you use AA and CC instead, the gradient will be…

Now investigate with the graph.

  1. Drag A to (1,1)(1, 1) and B to (4,3)(4, 3). Check the run, the rise and the formula below the graph.
  2. Slide the purple point P along the line, on both sides of A. Its triangle changes size. What happens to riseΓ·run\text{rise} \div \text{run}?
  3. Tick use B as the first point. Which numbers in the formula change? Does the answer change?
  4. Tick show the mixed-up-order mistake. What goes wrong, and why?
  5. Make a line that goes downhill, a horizontal line, and a vertical line. What happens to the formula each time?

Drag A and B (they snap to whole numbers). Then slide P along the line.

m=y2βˆ’y1x2βˆ’x1=3βˆ’(βˆ’1)3βˆ’(βˆ’3)=46=23m = \dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{3 - (-1)}{3 - (-3)} = \dfrac{4}{6} = \frac{2}{3}

A first, B second β€” the answer is 23\frac{2}{3} either way. Using A and P instead: βˆ’2βˆ’3=23\dfrac{-2}{-3} = \frac{2}{3}, the same gradient (β‰ˆ0.67\approx 0.67). Bigger or smaller triangle, same shape!

πŸ”Ž What do you notice?
  • The run is just the difference in the xx-coordinates, and the rise is the difference in the yy-coordinates. No counting needed. In try-first 1 the path goes 60βˆ’20=4060 - 20 = 40 m across and 35βˆ’15=2035 - 15 = 20 m up, so 2040=0.5\frac{20}{40} = 0.5 m up for each metre across, without drawing anything.
  • Negative coordinates need care. In try-first 2, from (βˆ’4,3)(-4, 3) to (2,βˆ’6)(2, -6) the move across is 2βˆ’(βˆ’4)=62 - (-4) = 6 (you pass 0 on the way) and the move up is βˆ’6βˆ’3=βˆ’9-6 - 3 = -9, so the answer is βˆ’96=βˆ’1.5\frac{-9}{6} = -1.5.
  • P’s triangle can be tiny or huge, but riseΓ·run\text{rise} \div \text{run} never changes. Any two points on a line give the same gradient.
  • Swapping which point comes first makes the top and the bottom of the fraction change sign. Since βˆ’aβˆ’b=ab\frac{-a}{-b} = \frac{a}{b}, the answer stays the same.
  • Mixing the order, as in y2βˆ’y1x1βˆ’x2\dfrac{y_2 - y_1}{x_1 - x_2} (top from A to B, bottom from B to A), flips only one sign, and the answer comes out with the wrong sign.
  • A horizontal line gives 0run=0\frac{0}{\text{run}} = 0. A vertical line gives a run of 0, so the gradient is undefined.
πŸ“ Key idea

The gradient formula

The gradient of the straight line through two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is

m=y2βˆ’y1x2βˆ’x1=Ξ”yΞ”x(x1β‰ x2)m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\Delta y}{\Delta x} \qquad (x_1 \neq x_2)

  • The small numbers are subscripts: x1x_1 means β€œthe xx-coordinate of the first point”. They are labels, not powers.
  • Order: you may choose either point to be β€œfirst”, but you must subtract in the same order on the top and the bottom. Both of these are correct: y2βˆ’y1x2βˆ’x1=y1βˆ’y2x1βˆ’x2\frac{y_2 - y_1}{x_2 - x_1} = \frac{y_1 - y_2}{x_1 - x_2}
  • Conditions: the two points must be different. If x1=x2x_1 = x_2, the line is vertical and the gradient is undefined. If y1=y2y_1 = y_2, the line is horizontal and m=0m = 0.
  • This is the same Ξ”yΞ”x\frac{\Delta y}{\Delta x} as the rate of change from Lesson 1. The gradient of a line is its rate of change.

Why any two points work. Take any two slope triangles on the same straight line. Their horizontal sides are parallel and their vertical sides are parallel, and they share the same slanted line. So they have the same angles: the triangles are similar, and one is an enlargement of the other. Enlarging multiplies the rise and the run by the same scale factor kk, and kΓ—risekΓ—run=riserun.\frac{k \times \text{rise}}{k \times \text{run}} = \frac{\text{rise}}{\text{run}}. So the gradient is a property of the line, not of the points you happened to pick.

πŸ” Why it works

Why subtracting gives the rise and the run. On a number line, going from βˆ’4-4 to 22 is a move of 2βˆ’(βˆ’4)=62 - (-4) = 6 to the right. β€œEnd minus start” is always the move you made, and it makes a move left or down negative by itself. So x2βˆ’x1x_2 - x_1 is the run and y2βˆ’y1y_2 - y_1 is the rise, going from the first point to the second.

Why either point can go first. Starting from the other point walks the same slope triangle backwards: the run and the rise both change sign. Two sign changes cancel, because a negative divided by a negative is positive: βˆ’6βˆ’8=68\frac{-6}{-8} = \frac{6}{8}.

Why a mixed order goes wrong. Taking the top from A to B but the bottom from B to A changes only one sign. You get the right size with the wrong sign (unless the gradient is 0), a line going up described as going down.

Why the formula needs x1β‰ x2x_1 \neq x_2. Equal xx-coordinates mean a run of 0, and there is no number to divide by 0. That is the vertical line again.

⚠️ Watch out

Brackets (American English: parentheses) around negatives. With the points (βˆ’3,4)(-3, 4) and (5,βˆ’2)(5, -2): Ξ”x=5βˆ’(βˆ’3)=5+3=8,notΒ 5βˆ’3=2.\Delta x = 5 - (-3) = 5 + 3 = 8, \quad \text{not } 5 - 3 = 2. Write the brackets every time you substitute a negative number. Many wrong answers come from this one slip.

Same order, top and bottom. y2βˆ’y1x1βˆ’x2\dfrac{y_2 - y_1}{x_1 - x_2} looks almost right, but it gives the right size with the wrong sign.

🧱 Worked example

Checking the hill sign

The bottom of the climb is (1500,120)(1500, 120) and the top is (4000,320)(4000, 320), both in metres.

Step 1 β€” Label the points

(x1,y1)=(1500,120)(x_1, y_1) = (1500, 120) and (x2,y2)=(4000,320)(x_2, y_2) = (4000, 320). (Either could be first, as long as we stay consistent.)

Step 2 β€” Substitute and calculate

m=y2βˆ’y1x2βˆ’x1=320βˆ’1204000βˆ’1500=2002500=0.08m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{320 - 120}{4000 - 1500} = \frac{200}{2500} = 0.08

Step 3 β€” Interpret (try this yourself first)

A gradient of 0.08 means the road climbs 0.08 m for every 1 m across, which is 8 m per 100 m: an 8% grade. The sign matches.

Step 4 β€” Is the answer sensible?
  • Sign: positive, and the road goes up from the first point to the second βœ“
  • Size: 0.08 is just under the steepest wheelchair ramp allowed (112β‰ˆ0.083\frac{1}{12} \approx 0.083) and far below a staircase (about 0.67). Kept up for 2.5 km, that is a serious climb on a bike, but believable βœ“
  • Units: both distances are in metres, so the gradient has no units βœ“
  • But: two points only give the average gradient. The road could be 4% in one place and 12% in another, and our calculation would never know. The sign is right on average. A cyclist might want to know the steepest part too. (You’ll explore this in the real-life task.)
🧱 Worked example

With negative coordinates

Find the gradient of the line through P(βˆ’3,4)P(-3, 4) and Q(5,βˆ’2)Q(5, -2).

Step 1 β€” Substitute, with brackets

m=βˆ’2βˆ’45βˆ’(βˆ’3)m = \frac{-2 - 4}{5 - (-3)}

Step 2 β€” Your turn: simplify (then open)

m=βˆ’68=βˆ’34m = \frac{-6}{8} = -\frac{3}{4}

Step 3 β€” Is the answer sensible?

Going from PP (left) to QQ (right), the yy-value falls from 4 to βˆ’2, so the line goes down: negative βœ“. As a final check, do it in the other order: 4βˆ’(βˆ’2)βˆ’3βˆ’5=6βˆ’8=βˆ’34\dfrac{4 - (-2)}{-3 - 5} = \dfrac{6}{-8} = -\dfrac{3}{4} βœ“

Foundation

Find the gradient of the line through (1,2)(1, 2) and (4,8)(4, 8).

Foundation

Find the gradient of the line through (βˆ’2,5)(-2, 5) and (3,βˆ’5)(3, -5).

🎬 Another explanation

Still stuck after the example? Hearing it from another teacher often helps. This video was checked against this lesson. Try the questions again afterwards.

Gradient between two points - Corbettmaths Β· corbettmaths Β· about 5 min

How the gradient formula comes from rise over run, and how to use it with two coordinates, including negative numbers, keeping the subtraction in the same order.

πŸ€” Pause and think

A line passes through (2,1)(2, 1) and has gradient 34\frac{3}{4}. Without drawing a graph, can you list three more points on the line? What about points to the left of (2,1)(2, 1)? (Hint: what does "34\frac{3}{4}" let you do, again and again?) In Lesson 4, this idea becomes the equation of a line.

Extension: lines made of blocks

A computer screen is a grid of tiny square pixels. It can’t draw a perfectly smooth sloping line. It can only light up whole squares. So how does it draw y=23xy = \frac{2}{3}x?

For each column x=0,1,2,3,…x = 0, 1, 2, 3, \dots, it lights the pixel in the row nearest to the true height 23x\frac{2}{3}x:

column xx0123456
true height 23x\frac{2}{3}x00.671.3322.673.334
pixel row lit0112334

The steps go up, stay, up, then up, stay, up again. The pattern repeats every 3 columns, rising 2, exactly the run and rise of 23\frac{2}{3}. Why does it repeat? After 3 columns, the line has risen exactly 2, a whole number of pixels. So it sits in exactly the same position relative to the pixel grid as it did at the start, and everything that follows is a copy.

This works for any gradient that is a fraction pq\frac{p}{q} in simplest form: the staircase repeats every qq columns, rising pp. But for a gradient like 2βˆ’1β‰ˆ0.414\sqrt{2} - 1 \approx 0.414, which can’t be written as a fraction, the line never lands exactly on a whole number again. The staircase has no repeating cycle at all. Here is why: if the jumps repeated every rr columns with a total rise of kk, the lit pixels would climb exactly kk every rr columns forever, so the line would never get more than a fixed distance away from the line y=krxy = \frac{k}{r}x. But two lines through the origin with different gradients drift further and further apart, so the gradient would have to equal the fraction kr\frac{k}{r}, and 2βˆ’1\sqrt{2} - 1 is not a fraction.

Try it: change the rise and run, and look for the repeat (the colours alternate for each copy). What happens with 24\frac{2}{4} compared with 12\frac{1}{2}? Then switch on the irrational gradient.

y=23 xy = \frac{2}{3}\,x

Steps up, column by column: 101 | 101 | 101 | 101 | 101 | 101 | 101 | 101 | 101 …

The pattern repeats every 3 columns (3 across, 2 up). Colours alternate for each repeat.

Drawing lines quickly on a pixel grid is a classic problem in computer graphics. A famous method published by Jack Bresenham in the 1960s draws lines using only whole-number arithmetic, by keeping track of how far the true line is from the pixel it has just lit. Ramps built in block-building games are the same idea, just with much bigger pixels.

⛏ Practice β€” choose your level

Find the gradient of the line through (2,3)(2, 3) and (6,13)(6, 13). Give your answer as a fraction or a decimal.

πŸ— Build project β€” real-life task

Is the hill sign honest?

A cycling club is planning a route over a hill. Their map gives these points along the road (horizontal distance from point A, and height above sea level):

pointABCD (top)
horizontal distance (m)0100020002500
height (m)200250350450

A sign at point A reads β€œ10% hill for 2.5 km”. Use gradients between pairs of points to decide whether the sign gives cyclists a fair picture. (These numbers are illustrative, but very similar to real climbs.)

IB StandardCriterion D

Find the gradient of the section from B to C, as a percentage grade.

%
IB StandardCriterion D

Which section of the road is the steepest?

IB StandardCriterion D

Find the average gradient of the whole climb, from A to D, as a percentage.

%
ExtensionCriterion D

The sign at A says "10% hill for 2.5 km". Your calculations show the average really is 10%.

Is the sign fair to cyclists? Use your gradients to explain, and suggest a better sign. Also: how much should we trust gradients worked out from only four points on a map?

πŸ““ Work it out in your notebook first β€” sketch, calculate, then write your answer here in full sentences. A model answer appears after you submit, so you can compare.

πŸ”— Connections

The formula m=y2βˆ’y1x2βˆ’x1m = \dfrac{y_2 - y_1}{x_2 - x_1} is used whenever two measurements are known and the steepness between them matters. Map apps calculate road gradients from height data. Scientists find speeds from two readings of a distance–time graph. Economists measure how fast prices rose between two years. Computer graphics draws every sloping line on your screen from just its two end points.

Next lesson you’ll meet the equation y=mx+cy = mx + c, where mm is exactly the gradient you have learned to find. Then two points will be enough to write the equation of a whole line.

πŸͺž Reflect

In your own words, explain why it doesn't matter which two points on a line you use to find its gradient. Mention triangles.

Which slip catches you more: subtracting a negative, or subtracting in a mixed-up order? Write one habit that will prevent it.

In the hill task, the average gradient was 'true' but still misleading. Where else might an average hide something important?

πŸ“– Read more in your book
  • Introduction to Algebra (Art of Problem Solving) β€” Chapter 8, sections 8.2–8.3 β€” the slope formula, and using slope to test whether points are in line

The book goes deeper and its problems are harder. Read it after this lesson, with a pencil in your hand.