Skip to content

Algebra 1 · Slope · 2 of 3

Slope from two points

Two points on a straight line are all you need to find its slope, with no graph. Subtract to get the rise and the run, then divide.

Made with AI. Not yet reviewed by a person. Report any error.

← Slope: all 3 pages Next: Slope as a rate of change →

The triangle between two points

On the page What slope measures, a line's slope was its rise (how far it goes up or down) divided by its run (how far it goes across). There we counted squares on a grid. Two points on the line are enough to do the same without one.

Join the two points with a right-angled triangle. From the first point, go straight across until you are directly below or above the second point. That side is the run: how much x changes. Then go straight up or down to the second point. That side is the rise: how much y changes. The line itself is the triangle's long side.

Two points on a straight line on a grid, joined by a right-angled triangle whose sides show the run across and the rise up. Two points on a straight line on a grid, joined by a right-angled triangle whose sides show the run across and the rise up.
Step 1 of 5

Try it yourself

2
4

Each square of the grid is 1 across and 1 up.

Figure 1. Two points on a line, the run and the rise between them, and the slope they give. Pick a step to hold it, or move the sliders.

Report an error

The slope formula

A point is a pair of numbers (x, y), its coordinates: how far across, then how far up. With two points we need names that tell their numbers apart, so we add a small number below each letter. The first point is (x1, y1) and the second is (x2, y2). Read x1 as "x sub 1". The 1 and 2 are only labels, not powers.

The rise is the second y take away the first y. The run is the second x take away the first x. Divide the rise by the run and you have the slope formula:

m=y2−y1x2−x1

The y's go on top and the x's underneath, the same way up as rise over run. For the figure's points (−2, −2) and (2, 4), that is m = 4−(−2)2−(−2) = 64 = 1.5.

Take care when you subtract a negative number. Write it in brackets first: 4 − (−2) is the same as 4 + 2, which is 6.

Any two points give the same slope

A straight line is equally steep all along it, so it doesn't matter which two of its points you use. In step 5 of the figure, the points (0, 1) and (2, 4) make a smaller triangle, with a rise of 3 and a run of 2. Both are half as big as before, and 3 ÷ 2 is still 1.5.

So choose the two points that make the arithmetic easiest.

Which point comes first?

Either point can be the first one. If you swap them, you go round the triangle the other way. Moving to the left gives a negative run, and moving down gives a negative rise.

Swapping the points changes the sign of both numbers at once. Changing the sign of both the top and the bottom of a division leaves the answer the same, so the slope comes out the same. Going from (2, 4) back to (−2, −2), the rise is −6 and the run is −4, and −6 ÷ −4 = 1.5.

Two points A and B on a line, with arrows counting the run across and the rise up or down, first from A to B and then from B to A. Two points A and B on a line, with arrows counting the run across and the rise up or down, first from A to B and then from B to A.
Step 1 of 5

Arrows to the right or up count as positive; to the left or down, negative.

Figure 2. The same two points counted each way round, then a falling line, then one point above the other. Pick a step to hold it.

Report an error

The arrows in the figure point the way you count. A falling line has a negative slope whichever way round you go: one of the two numbers is negative and the other positive.

If you want a habit, start from the point on the left. Then the run is always positive, and the sign of the rise alone tells you whether the line goes up or down.

When the x's or the y's are the same

If both points have the same y, the rise is 0. Then the slope is 0 divided by the run, which is 0, and the line is flat (horizontal). For (−3, 2) and (4, 2), m = 2−24−(−3) = 07 = 0.

If both points have the same x, the run is 0, and the formula asks you to divide by 0. That has no answer, so the slope is undefined. One point is straight above the other, and the line through them is vertical (upright). Step 5 of the second figure shows it. You can also try it in the first figure: slide the second point's x until it matches the first point's.

Worked example

A slope from two points, one with a negative coordinate

Find the slope of the line through the points (−2, 5) and (4, 1).

  1. Call (−2, 5) the first point and (4, 1) the second: x1 = −2, y1 = 5, x2 = 4 and y2 = 1.
  2. The rise: y2 − y1 = 1 − 5 = −4.
  3. The run: x2 − x1 = 4 − (−2) = 4 + 2 = 6.
  4. Divide and simplify: m = −46 = −23.

The slope is −23. The line falls 2 for every 3 across.

Check the sign. The point on the right, (4, 1), is lower than the one on the left, so the line falls and its slope must be negative.

In short

  • The slope through (x1, y1) and (x2, y2) is m = y2−y1x2−x1: the change in y over the change in x.
  • Either point can come first, as long as it comes first both on top and underneath.
  • Equal y's give a slope of 0. Equal x's give a run of 0, so the slope is undefined.

Check yourself

Three questions on this page. Each answer shows at once, with why.

Question 1 of 3

What is the slope of the line through (−1, 3) and (2, −3)?

Show the answer

The answer: −2

The rise is −3 − 3 = −6 and the run is 2 − (−1) = 3, so m = −6 ÷ 3 = −2. 2 comes from subtracting the y's and the x's in different orders, −12 puts the run over the rise, and −6 is the rise alone.

Question 2 of 3

Two students find the slope through the same two points. One works out y2−y1x2−x1 and the other y1−y2x1−x2. What do they get?

Show the answer

The answer: The same slope

The second way swaps both subtractions, so the rise and the run both change sign, and changing the sign of both the top and the bottom of a division leaves the answer the same. The sign changes only when one subtraction is swapped and not the other, 1 divided by the slope comes from putting the x's on top, and either point may come first.

Question 3 of 3

What is the slope of the line through (3, −1) and (3, 4)?

Show the answer

The answer: Undefined

Both x's are 3, so the run is 3 − 3 = 0, and dividing by 0 has no answer: the line is vertical. 0 is the slope of a flat line, where the y's match, and 5 and −5 are the rise alone, counted one way or the other.

Next · 3 of 3 Slope as a rate of change What the slope means in a story: a unit rate →

Revising maths?

Upload the lecture, slides or PDF. QuizWhiz turns it into notes and practice questions, each linked back to the moment it came from.

Make my notes, free

Your first 3 sources in full. Then 1 a month (the first 90 minutes or 30 pages; the rest waits), plus 3 short pastes

A sample note

When a signal molecule binds, the receptor changes shape.

41:30

Practice question: which enzyme converts cAMP to AMP, switching the signal off?

How this page was made

Made with AI, from the sources below · Report an error

Sources

  1. OpenStax Elementary Algebra 4.4, “4.4 Understand Slope of a Line” (CC BY 4.0) · Archived copy
  2. Wikipedia: Slope, “Slope” (CC BY-SA 4.0)

Every number in the figures and questions comes from the figures’ own maths. Not yet reviewed by a person.

What this page leaves out

  • Writing the equation of the line through two points, which starts from the slope found here.
  • The shorthand Δy and Δx for the change in y and the change in x (Δ is the Greek letter delta).
  • Points whose coordinates are fractions or decimals. The formula works the same way for them.
  • What a slope means in a real situation, such as a speed: that is the next page in the chapter.
  • The figures use points on whole-number grid corners, so the rise and the run are whole numbers.
  • The first figure's sliders move only the second point; the first stays where the step put it.

Something on this page looks wrong? Report an error

Report an error

Open