Distance Formula
What is the Distance Formula?
The distance formula finds the straight-line distance between two points on a coordinate plane. It's derived directly from the Pythagorean theorem: the horizontal gap (x₂−x₁) and vertical gap (y₂−y₁) between the points form the two legs of a right triangle, and the distance between the points is that triangle's hypotenuse.
The formula extends naturally to three dimensions by adding a third squared term for the z-coordinates: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²).
What Each Variable Means
When to Use It
- Finding the straight-line distance between two points on a map or graph
- Verifying whether three points form a particular type of triangle by comparing side lengths
- As a building block for circle equations and other coordinate geometry problems
Where This Formula Comes From
The horizontal and vertical differences between them form two legs of a right triangle, with the segment connecting the points as the hypotenuse.
The hypotenuse squared equals the sum of the legs squared.
d² = (x₂ - x₁)² + (y₂ - y₁)²Solve for the distance itself.
d = √((x₂ - x₁)² + (y₂ - y₁)²)Step-by-Step Example
Problem: Find the distance between points (1, 2) and (4, 6).
Assign each point's x and y values.
x₁=1, y₁=2, x₂=4, y₂=6Subtract the x-values and the y-values.
(x₂-x₁) = 3, (y₂-y₁) = 4Square both results.
3² = 9, 4² = 16Sum the squares, then take the square root.
d = √(9 + 16) = √25Interactive Calculator
Common Mistakes
Mistake: Subtracting in the wrong order and losing track of which point is which.
Fix: The subtraction order doesn't matter for the final answer (both differences get squared, so signs cancel), but stay consistent — pick one point as (x₁,y₁) and keep it that way through the whole calculation.
Mistake: Forgetting to square each difference before adding.
Fix: You must square (x₂-x₁) and (y₂-y₁) individually before adding them — adding first and squaring the sum gives a different, wrong result.
Practice Questions
Find the distance between (0, 0) and (6, 8).
Hint: This is a 6-8-10 right triangle, a multiple of the 3-4-5 triangle.
Find the distance between (-2, 3) and (1, -1).
Frequently Asked Questions
Does the distance formula work in 3D?
Yes — add a third squared term for the z-coordinates: d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²).
Why is it related to the Pythagorean theorem?
Because the horizontal and vertical gaps between two points literally form the two legs of a right triangle, with the straight-line distance as the hypotenuse.
Related Formulas
Pythagorean Theorem
Relates the three sides of a right triangle, letting you find any one side from the other two.
Learn more →Midpoint Formula
Finds the exact point halfway between two coordinates by averaging their x- and y-values.
Learn more →Slope-Intercept Form
The most common way to write the equation of a straight line, revealing its slope and y-intercept directly.
Learn more →