The distance formula looks like a memorization task: d = √((x₂ − x₁)² + (y₂ − y₁)²). But it's not a new formula at all — it's the Pythagorean theorem written in coordinate notation. Once you see the connection, you don't have to memorize anything.

The setup

Given two points P₁ = (x₁, y₁) and P₂ = (x₂, y₂) in the coordinate plane, you want the straight-line distance d between them.

Build a right triangle:

  • Horizontal leg: from (x₁, y₁) to (x₂, y₁). Length = |x₂ − x₁|.
  • Vertical leg: from (x₂, y₁) to (x₂, y₂). Length = |y₂ − y₁|.
  • Hypotenuse: from (x₁, y₁) directly to (x₂, y₂). Length = d.

The two legs are perpendicular (one horizontal, one vertical), so this is a right triangle. The Pythagorean theorem applies directly:

(x₂ − x₁)² + (y₂ − y₁)² = d²

Take the square root: d = √((x₂ − x₁)² + (y₂ − y₁)²). That's the distance formula. No memorization needed — derive it every time.

Why squaring eliminates the absolute value

You might object: shouldn't the legs be |x₂ − x₁| and |y₂ − y₁| since lengths can't be negative? They should — but squaring eliminates the sign. (x₂ − x₁)² = (x₁ − x₂)² no matter which point you label "1" or "2." That's why the distance formula doesn't carry absolute value bars.

Worked example: distance between (1, 2) and (4, 6)

  • Δx = 4 − 1 = 3
  • Δy = 6 − 2 = 4
  • d = √(3² + 4²) = √(9 + 16) = √25 = 5

Look familiar? It's a 3-4-5 right triangle in disguise — the most famous Pythagorean triple. Many SAT distance problems hide a Pythagorean triple this way.

Worked example with negative coordinates

Distance from (−3, 4) to (5, −2):

  • Δx = 5 − (−3) = 8
  • Δy = −2 − 4 = −6
  • d = √(64 + 36) = √100 = 10

Notice Δy is negative, but Δy² = 36 is positive. The signs don't matter once you square.

Extension to 3D

For 3D points (x₁, y₁, z₁) and (x₂, y₂, z₂):

d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)

Same idea, just one more squared term. This is the 3D Pythagorean theorem — the diagonal of a rectangular box has length √(L² + W² + H²).

It generalizes further: for n-dimensional points, distance is √(sum of squared coordinate differences). Used in machine learning all the time — "Euclidean distance" between feature vectors in high-dimensional spaces is exactly this generalization.

Distance vs displacement

Distance is always nonnegative. The straight-line distance from A to B is the same as from B to A. Displacement is a different concept — it's a directed quantity (a vector) and it cares about which way you went. In physics, displacement = change in position; distance = total path length traveled.

For two specific points connected by a straight line, distance and displacement magnitudes match. For curved or zigzag paths, distance is bigger than displacement.

The midpoint formula and section formula

The same coordinate-plane setup gives midpoint:

M = ((x₁ + x₂)/2, (y₁ + y₂)/2)

And the more general section formula divides the segment in any ratio m:n:

P = ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n))

m:n = 1:1 is the midpoint case.

Common pitfalls

  • Forgetting to square BOTH differences. A common rushed mistake: writing d = √((x₂−x₁) + (y₂−y₁))². That's wrong by a wide margin.
  • Subtracting in the wrong order with negative numbers. Δx is just whichever way you write it; squaring fixes the sign. But verify by inserting numerical values into your formula before pressing equals.
  • Confusing distance formula with slope formula. Slope = Δy/Δx (a quotient). Distance = √(Δx² + Δy²) (a square root of a sum). Same Δx and Δy, different operations.

Why this matters beyond geometry class

Computer graphics, GPS, machine learning, robotics — they all need to compute distances between points constantly. Game engines run the distance formula thousands of times per second to detect collisions. Recommendation engines compute distances in feature spaces with hundreds of dimensions. The simple coordinate-plane formula is the foundational case.

Run the numbers

Our distance formula calculator takes any two points and returns the distance plus the Δx and Δy components. Useful for SAT geometry problems, plotting points, or just verifying that you set up the formula correctly.