MATH 1 • GEOMETRY

Distance Formula — I can compute distance between two points and interpret it in a context.

Turn any two coordinate points into a precise measurement of the straight-line distance between them.

Historical Context & Motivation

How far apart are two cities on a map? How long is the diagonal of a soccer field? Humans have been measuring distances for thousands of years, but a reliable formula for computing straight-line distance between two locations took centuries to develop. The story begins in ancient Greece with a famous theorem about right triangles and reaches its modern form only after mathematicians invented the coordinate plane.

~500 BCE
Pythagorean Theorem
Greek mathematicians, including followers of Pythagoras, formally prove that in a right triangle the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c².
~300 BCE
Euclid's Elements
Euclid compiles and rigorously proves geometric theorems—including the Pythagorean Theorem—in his thirteen-book masterwork, making distance reasoning systematic.
1637
Descartes' Coordinate System
René Descartes publishes La Géométrie, introducing the x-y coordinate plane. Geometry and algebra merge, allowing points to be described by ordered pairs.
1700s
Distance Formula Emerges
Mathematicians apply the Pythagorean Theorem directly to the coordinate plane, producing the distance formula as a standard algebraic tool for analytic geometry.

The central question the distance formula answers is straightforward: given two points on the coordinate plane, what is the exact straight-line distance between them? Because the formula is just the Pythagorean Theorem in disguise, every time you use it you are building a right triangle, computing its leg lengths, and finding its hypotenuse.

Core Principles & Definitions

Before you plug numbers into any equation, it helps to understand the handful of ideas that make the distance formula work. Each principle below connects the algebra you see on paper to the geometry you can picture on a graph.

1

Ordered Pairs

Every point on the coordinate plane is described by an ordered pair (x, y). The first value tells how far right or left; the second tells how far up or down from the origin.
2

Horizontal & Vertical Distances

The horizontal distance between two points is the absolute difference of their x-coordinates. The vertical distance is the absolute difference of their y-coordinates.
3

Right-Triangle Connection

Those horizontal and vertical distances form the two legs of a right triangle. The straight-line distance between the points is the hypotenuse of that triangle.
4

Pythagorean Theorem

For any right triangle with legs a and b and hypotenuse c, a² + b² = c². Solving for c gives c = √(a² + b²), which is exactly the distance formula.
KEY TAKEAWAY
Think of the distance formula as a GPS shortcut. Imagine you are standing at one intersection in a city grid and need to know the "as-the-crow-flies" distance to another intersection. You could walk east a certain number of blocks (horizontal leg) and then north a certain number of blocks (vertical leg), forming an L-shape. The distance formula tells you how long the diagonal shortcut would be if you could walk straight through the buildings. The Pythagorean Theorem is doing all the heavy lifting.

Visual Explanation

The diagram below shows exactly how the distance formula works geometrically. Two points, A and B, sit on the coordinate plane, and a dashed right triangle is drawn between them. Study the horizontal leg, the vertical leg, and the hypotenuse—the hypotenuse length is the distance the formula calculates.

Point A (2, 2) and point B (8, 7) define a right triangle. The horizontal leg (Δx = 6) and vertical leg (Δy = 5) combine via the Pythagorean Theorem to produce the hypotenuse d = √61 ≈ 7.81 units.

Notice how the dashed yellow line (the horizontal leg) runs from x = 2 to x = 8, giving a length of 6. The dashed green line (the vertical leg) runs from y = 2 to y = 7, giving a length of 5. The solid pink line is the hypotenuse—the actual straight-line distance we want. The right-angle box in the corner confirms the triangle is a right triangle, which means the Pythagorean Theorem applies directly.

Mathematical Framework

The distance formula is derived straight from the Pythagorean Theorem applied to the coordinate plane. Here is the formal statement of the theorem, followed by the distance formula itself.

PYTHAGOREAN THEOREM
a² + b² = c²
In a right triangle, a and b are the lengths of the two legs, and c is the length of the hypotenuse (the side opposite the right angle).
DISTANCE FORMULA
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Where (x₁, y₁) and (x₂, y₂) are the coordinates of two points, and d is the straight-line distance between them. The expression (x₂ − x₁) represents the horizontal leg, and (y₂ − y₁) represents the vertical leg of the right triangle.

Notice that squaring each difference before adding eliminates any issues with negative signs. Whether x₂ is bigger or smaller than x₁ does not matter, because (−3)² and 3² both equal 9. This means you can label the two points in any order and still get the same distance.

SIMPLIFIED FORM
d² = (Δx)² + (Δy)²
Here Δx ("delta x") means the change in x, and Δy means the change in y. This compact notation emphasizes that the formula finds the hypotenuse of a triangle whose legs are the horizontal and vertical changes.
💡 Order Doesn't Matter
It makes no difference which point you call (x₁, y₁) and which you call (x₂, y₂). Subtracting in the opposite order flips the sign, but squaring removes the negative. The final distance is always the same positive value.

Step-by-Step Breakdown

Every distance-formula problem follows the same four-step process. The diagram below maps those steps visually, and the table that follows summarizes what to do and what to watch out for at each stage.

A four-step flowchart shows the process from identifying coordinates through subtraction, squaring-and-adding, to taking the square root. The worked example below uses points A (−3, 1) and B (5, 7) to produce a clean answer of d = 10 units.
Step-by-step process with common pitfalls
StepWhat You DoCommon Mistakes to Avoid
1 — IdentifyLabel the two points as (x₁, y₁) and (x₂, y₂).Don't mix up x- and y-values—keep each pair together.
2 — SubtractCompute x₂ − x₁ and y₂ − y₁ separately.Watch sign errors with negatives: 5 − (−3) = 8, not 2.
3 — Square & AddSquare each difference, then add the two squares.Square before adding—don't add the differences first and then square.
4 — Square RootTake the principal (positive) square root of the sum.Simplify the radical if possible: √50 = 5√2.

Worked Example

Let's work through a contextual problem from start to finish. Suppose a drone takes off from a rooftop helipad located at coordinate (−4, 3) on a city grid and flies in a straight line to a delivery point at (8, −2). Each grid unit represents 100 meters. How far does the drone fly, in meters?

Drone Delivery Distance
1
Step 1 — Identify the coordinatesLabel the takeoff point as (x₁, y₁) = (−4, 3) and the delivery point as (x₂, y₂) = (8, −2).
(x₁, y₁) = (−4, 3) (x₂, y₂) = (8, −2)
2
Step 2 — Find the horizontal and vertical differencesCompute Δx = x₂ − x₁ = 8 − (−4) = 8 + 4 = 12. Then compute Δy = y₂ − y₁ = −2 − 3 = −5. The negative sign on Δy simply means the drone moved downward; it won't affect the final distance because we will square it.
Δx = 12, Δy = −5
3
Step 3 — Square each difference and addSquare Δx: 12² = 144. Square Δy: (−5)² = 25. Add the squares: 144 + 25 = 169.
(Δx)² + (Δy)² = 144 + 25 = 169
4
Step 4 — Take the square rootd = √169 = 13 grid units. Since each grid unit is 100 meters, multiply: 13 × 100 = 1 300 meters.
d = 13 units = 1 300 meters
5
Step 5 — InterpretThe drone flies exactly 1 300 meters (1.3 km) in a straight line from the helipad to the delivery point. If the drone's battery supports a 2 km range, it can make this trip with room to spare.
The drone travels 1.3 km—well within its 2 km range.

Strengths, Limitations & Variations

The distance formula is one of the most useful tools in coordinate geometry, but like any formula it has both ideal use cases and situations where other approaches work better. The table below lays out its strengths alongside its limitations.

Comparing the distance formula's strengths and limitations
StrengthsLimitations
Works for any two points on the coordinate plane, regardless of quadrant or sign.Only gives straight-line ("as-the-crow-flies") distance, not the path along roads or curves.
Exact answer—no estimation required. Results are precise, either whole numbers or simplified radicals.Requires a coordinate system. If points are described without coordinates, you may need to set one up first.
Extends naturally to 3D: d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²].On the surface of the Earth, latitude and longitude require the Haversine formula, not the flat-plane distance formula.
Foundation for many other formulas: midpoint, circle equations, and slope-intercept proofs.Can produce irrational numbers (like √2) that must be approximated with a calculator for practical use.
WHEN TO USE WHAT
Use the distance formula whenever you have two coordinate pairs and need the straight-line distance between them. If you only need the horizontal or vertical distance (not the diagonal), simply subtract the relevant x- or y-coordinates—no formula needed. And if you are working on a curved surface like the Earth, you will eventually learn more advanced tools in trigonometry.

Connection to Advanced Topics

The distance formula you learn in Math 1 is actually a stepping stone to powerful ideas in more advanced courses. Below is a comparison between the 2D version you are mastering now and extensions you will encounter later.

2D distance formula versus advanced extensions
Feature2D Distance (This Course)Advanced Extensions
DimensionsTwo: x and yThree (x, y, z) in Geometry or Physics; n-dimensions in linear algebra.
SurfaceFlat coordinate planeCurved surfaces use the Haversine or great-circle distance formulas.
ApplicationsClassroom geometry, simple coordinate proofsComputer graphics, GPS navigation, machine learning (Euclidean distance between data points).
Related FormulasMidpoint formula, slope formulaEquation of a circle (x − h)² + (y − k)² = r² is literally the distance formula set equal to a constant radius.

One of the most important connections to notice right now is the equation of a circle. A circle is defined as all points that are a fixed distance r from a center (h, k). If you set d = r in the distance formula and square both sides, you get (x − h)² + (y − k)² = r². So every time you use the equation of a circle, the distance formula is running behind the scenes.

Practice Problems

Try these five problems to solidify your understanding. They start with a concept check and build up to a challenge that asks you to think critically.

PROBLEM 1CONCEPTUAL
Explain in your own words why the distance formula always gives a positive value, even when one or both of the coordinate differences are negative.
PROBLEM 2BASIC CALCULATION
Find the distance between the points (1, 3) and (4, 7).
PROBLEM 3INTERMEDIATE
Find the distance between (−6, 2) and (3, −10). Give your answer as a simplified radical.
PROBLEM 4APPLIED
A park ranger's station is at (2, 5) on a trail map, and a lost hiker radios in their GPS position as (−7, −1). Each map unit equals 0.25 miles. How far is the ranger from the hiker, in miles? Round to the nearest tenth.
PROBLEM 5CRITICAL THINKING
Point C is at (1, 2) and point D is at (1 + a, 2 + a) where a > 0. Express the distance CD in terms of a. Then determine the value of a that makes CD equal to 10.

Lesson Summary

The distance formula — d = √[(x₂ − x₁)² + (y₂ − y₁)²] — is a direct application of the Pythagorean Theorem to the coordinate plane. You form a right triangle whose horizontal leg is the difference in x-coordinates and whose vertical leg is the difference in y-coordinates. Squaring these differences, adding them, and taking the square root gives the straight-line distance between any two points.

Remember to follow the four-step process: identify coordinates, subtract, square and add, then take the square root. Watch for sign errors with negative coordinates, and always interpret your result in context when the problem involves real-world units. This formula connects forward to the equation of a circle, the midpoint formula, and eventually to 3D distance calculations and beyond.

Varsity Tutors • Math 1 • Distance Formula