Mathwords logoMathwords

Distance Formula

Distance Formula

The formula Square root of (x₂ minus x₁) squared plus (y₂ minus y₁) squared is the distance between points (x1, y1) and (x2, y2).

 

Two distance formulas: on a plane: √((x₂-x₁)²+(y₂-y₁)²); in 3D: √((x₂-x₁)²+(y₂-y₁)²+(z₂-z₁)²)

 

See also

Distance from a point to a line, plane, three dimensions

Key Formula

d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
Where:
  • dd = The distance between the two points
  • (x1,y1)(x_1, y_1) = The coordinates of the first point
  • (x2,y2)(x_2, y_2) = The coordinates of the second point

Worked Example

Problem: Find the distance between the points (1, 2) and (4, 6).
Step 1: Identify the coordinates. Let (x₁, y₁) = (1, 2) and (x₂, y₂) = (4, 6).
x1=1,  y1=2,  x2=4,  y2=6x_1 = 1,\; y_1 = 2,\; x_2 = 4,\; y_2 = 6
Step 2: Substitute into the distance formula.
d=(41)2+(62)2d = \sqrt{(4 - 1)^2 + (6 - 2)^2}
Step 3: Compute the differences and square them.
d=32+42=9+16d = \sqrt{3^2 + 4^2} = \sqrt{9 + 16}
Step 4: Add the squared terms and take the square root.
d=25=5d = \sqrt{25} = 5
Answer: The distance between (1, 2) and (4, 6) is 5 units.

Another Example

This example involves negative coordinates, which is where sign errors commonly occur. It demonstrates that subtracting a negative number produces a positive difference.

Problem: Find the distance between the points (−3, 7) and (2, −5).
Step 1: Assign the coordinates. Let (x₁, y₁) = (−3, 7) and (x₂, y₂) = (2, −5).
x1=3,  y1=7,  x2=2,  y2=5x_1 = -3,\; y_1 = 7,\; x_2 = 2,\; y_2 = -5
Step 2: Substitute into the formula, being careful with the negative signs.
d=(2(3))2+(57)2d = \sqrt{(2 - (-3))^2 + (-5 - 7)^2}
Step 3: Simplify the expressions inside the parentheses.
d=52+(12)2=25+144d = \sqrt{5^2 + (-12)^2} = \sqrt{25 + 144}
Step 4: Add and take the square root.
d=169=13d = \sqrt{169} = 13
Answer: The distance between (−3, 7) and (2, −5) is 13 units.

Frequently Asked Questions

Where does the Distance Formula come from?
The Distance Formula is derived from the Pythagorean theorem. If you draw a right triangle where the horizontal leg has length |x₂ − x₁| and the vertical leg has length |y₂ − y₁|, then the hypotenuse is the distance between the two points. Applying a² + b² = c² and solving for c gives you the Distance Formula.
Does it matter which point is (x₁, y₁) and which is (x₂, y₂)?
No, it does not matter. Because each difference is squared, the result is always positive regardless of which point you call first. Swapping the two points gives the same distance.
What is the Distance Formula in 3D?
In three dimensions, the formula extends to d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. You simply add a third squared difference for the z-coordinates. The logic is the same — it generalizes the Pythagorean theorem to one more dimension.

Distance Formula vs. Midpoint Formula

Distance FormulaMidpoint Formula
What it findsThe length of the segment between two pointsThe point exactly halfway between two points
Formulad = √[(x₂ − x₁)² + (y₂ − y₁)²]M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Result typeA single number (a distance)An ordered pair (a point)
Based onPythagorean theoremAveraging coordinates

Why It Matters

The Distance Formula appears throughout algebra, geometry, trigonometry, and physics whenever you need to measure how far apart two objects or locations are on a coordinate grid. You will use it to prove geometric properties like showing a triangle is isosceles, to find the length of a side in coordinate geometry proofs, and to calculate magnitudes of vectors. It also underpins the equation of a circle, since a circle is defined as all points at a fixed distance (the radius) from a center point.

Common Mistakes

Mistake: Forgetting to square the differences before adding them — writing √[(x₂ − x₁) + (y₂ − y₁)] instead of √[(x₂ − x₁)² + (y₂ − y₁)²].
Correction: Always square each difference first, then add, then take the square root. The squaring is essential because it comes from the Pythagorean theorem.
Mistake: Making sign errors when coordinates are negative, such as computing (2 − (−3)) as −1 instead of 5.
Correction: Subtracting a negative number means you add its absolute value. Write it out carefully: 2 − (−3) = 2 + 3 = 5. Double-check your signs before squaring.

Related Terms