Slope and Distance Between Two Points Explained

Two points on a map: how steep is the line between them, and how far apart are they? Coordinate geometry answers both with two short formulas. Slope measures steepness with m = (y2 – y1) / (x2 – x1), and distance measures length with d = sqrt((x2 – x1)^2 + (y2 – y1)^2). Give each point an (x, y) address, plug the numbers in, and you get a clear answer for slope and distance between two points.

Quick Answer
Slope tells you how steep a line is: m = (y2 – y1) / (x2 – x1), which is rise over run. Distance tells you how long the line segment is: d = sqrt((x2 – x1)^2 + (y2 – y1)^2). For the points (1, 2) and (4, 6), the slope is 4 / 3, about 1.33, and the distance is exactly 5. Positive slope rises, negative slope falls, zero slope is flat, and a vertical line has an undefined slope.

What Slope Is

Slope is a number that describes how steep a line is. It answers a simple question: as you move to the right, does the line climb, fall, or stay level? A steeper line has a slope farther from zero.

The everyday name for slope is “rise over run.” The rise is how much the line goes up or down. The run is how much it moves across. Divide the rise by the run and you have the slope.

Slope stays the same everywhere along a straight line. Pick any two points on that line and the rise over run gives the same value. That steady rate is what makes a line straight in the first place.

Think of walking up a ramp. If you climb 3 feet for every 6 feet you walk forward, the slope is 3 / 6, or 0.5. A bigger rise for the same run means a steeper climb and a larger slope.

Slope is used far beyond math class. Road signs list a grade like 6 percent, which is really a slope. Roofs, wheelchair ramps, and hiking trails all use the same rise over run idea to describe how sharply they climb.

The Slope Formula

To find slope between two points, label them (x1, y1) and (x2, y2), then use the formula below.

m = (y2 – y1) / (x2 – x1)

The top, y2 – y1, is the rise. The bottom, x2 – x1, is the run. Let us work the Quick Answer example step by step.

Take the points (1, 2) and (4, 6). Set x1 = 1, y1 = 2, x2 = 4, and y2 = 6. Now substitute:

m = (6 – 2) / (4 – 1) = 4 / 3 = 1.33 (approx).

So the line rises 4 units for every 3 units it moves right. It does not matter which point you call first, as long as you keep the x and y values in the same order on top and bottom.

Try swapping the points to prove it. With (4, 6) first, m = (2 – 6) / (1 – 4) = -4 / -3 = 4 / 3. The two negatives cancel, so the slope is still 4 / 3. A Slope Calculator does this subtraction for you and checks your work.

Slope of the line through the points (1, 2) and (4, 6) shown as a rise over run triangle A coordinate grid plots the points (1, 2) and (4, 6). A right triangle under the line shows a run of 3 across the bottom and a rise of 4 up the side, giving a slope of 4 over 3. (1, 2) (4, 6) run = 3 rise = 4 slope = rise / run = 4 / 3
The run of 3 and rise of 4 give a slope of 4 / 3 for the line through (1, 2) and (4, 6).

Reading Slope: Positive, Negative, Zero, Undefined

The sign and size of the slope tell a quick story about the line. Once you know the number, you can picture the line without plotting it. Here are the four cases you will meet.

  • Positive slope: the line goes up from left to right. As x grows, y grows. Our example, 4 / 3, is positive.
  • Negative slope: the line goes down from left to right. As x grows, y shrinks, so the rise is negative.
  • Zero slope: the line is flat and horizontal. The rise is 0, so 0 divided by the run is 0. Both points share the same y value.
  • Undefined slope: the line is vertical. The run is 0, and dividing by zero is not allowed, so the slope is undefined. Both points share the same x value.

A larger number, positive or negative, means a steeper line. A slope of 5 climbs sharply, while a slope of 0.2 is nearly flat. A quick check for horizontal and vertical lines: if the y values match, the slope is zero, and if the x values match, the slope is undefined.

The Distance Formula

Slope tells you how steep the line is. Distance tells you how long the segment between the two points is. The distance formula gives that straight-line length.

d = sqrt((x2 – x1)^2 + (y2 – y1)^2)

You find the horizontal gap and the vertical gap, square each one, add them, and take the square root. Squaring keeps every term positive, which is why the result is always a real, non-negative length. Let us use the same points, (1, 2) and (4, 6), and show every step.

  • Horizontal gap: x2 – x1 = 4 – 1 = 3.
  • Vertical gap: y2 – y1 = 6 – 2 = 4.
  • Square and add: 3^2 + 4^2 = 9 + 16 = 25.
  • Take the root: d = sqrt(25) = 5.

So the two points are exactly 5 units apart. Squaring removes any negative signs, so the order of the points does not change the answer. Most answers are not whole numbers, so you often round, such as sqrt(20), which is about 4.47. A Distance Calculator handles the squaring and the square root for you.

Distance between the points (1, 2) and (4, 6) shown as the hypotenuse of a right triangle The same two points are joined by a straight line. A horizontal leg of 3 and a vertical leg of 4 form a right triangle whose hypotenuse, the distance, equals 5. (1, 2) (4, 6) 3 4 d = 5 sqrt(3^2 + 4^2) = 5
The distance is the hypotenuse: legs of 3 and 4 give sqrt(9 + 16) = sqrt(25) = 5.

Why the Distance Formula Is the Pythagorean Theorem

Look closely at the second picture and you will see a right triangle. The horizontal gap and the vertical gap are the two legs, and the distance is the hypotenuse joining the points.

The distance formula is simply the Pythagorean theorem, a^2 + b^2 = c^2, applied to a grid, where c is the straight-line distance. That is why a run of 3 and a rise of 4 give a distance of 5, the classic 3-4-5 triangle. Once you notice this link, you never have to memorize the distance formula on its own.

We keep this article focused on two points, so for the full proof and more examples see our sibling guide on the Pythagorean theorem explained. If you need lengths and areas of full shapes instead, our guide on how to find the area of any shape is a good next stop.

Ready to skip the arithmetic? Find the steepness of any line with our Slope Calculator, then measure the gap between the same two points with our Distance Calculator. Enter two coordinate pairs and both give an instant, checked answer.

Frequently Asked Questions About Slope and Distance

What Are the Slope and Distance Formulas?

Slope is m = (y2 – y1) / (x2 – x1), which is the rise divided by the run. Distance is d = sqrt((x2 – x1)^2 + (y2 – y1)^2), the straight-line length between the points. Slope measures steepness, and distance measures how far apart the two points are.

Does the Order of the Two Points Matter?

For slope, the order does not matter as long as you keep x and y in the same order on the top and bottom. For distance, the order never matters, because squaring the gaps removes any negative signs. Either way, you get the same final answer.

What Does a Zero Slope Mean?

A zero slope means the line is flat and horizontal. The rise is 0, so 0 divided by the run equals 0. Both points have the same y value. Walking along the line, you move sideways without going up or down at all.

Why Is a Vertical Line’s Slope Undefined?

A vertical line has a run of 0 because both points share the same x value. The slope formula would ask you to divide by zero, which is not allowed in math. So we say the slope of a vertical line is undefined rather than giving it a number.

How Do I Find the Distance Between (1, 2) and (4, 6)?

Find the gaps first: 4 – 1 = 3 across and 6 – 2 = 4 up. Square and add them: 3^2 + 4^2 = 9 + 16 = 25. Take the square root: sqrt(25) = 5. The two points are exactly 5 units apart.

Is the Distance Formula the Same as the Pythagorean Theorem?

Yes. The horizontal and vertical gaps are the two legs of a right triangle, and the distance is the hypotenuse. Plugging them into a^2 + b^2 = c^2 and solving for c gives the distance formula. It is the Pythagorean theorem drawn on a coordinate grid.

Can Slope and Distance Be Negative?

Slope can be negative, which means the line falls from left to right as x increases. Distance can never be negative, because it is a length. The square root in the distance formula always returns a value of zero or more, so the result is never below zero.

Sources

References Used in This Article

This article is for general education only. Always double-check the formulas and math for your own problem before you rely on the result. Reviewed for accuracy by Prof. Dr. Khalil Mudassar, PhD. Last updated September 11, 2026.


Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.

Leave a Comment