The distance formula and midpoint formula are two of the most-used results in coordinate geometry. They take two points (x₁, y₁) and (x₂, y₂) and instantly give you (a) how far apart they are, and (b) the exact center of the segment connecting them. This guide derives both from scratch, shows worked examples, and extends to 3D.
d = √((x₂ − x₁)² + (y₂ − y₁)²)
M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)
It’s literally the Pythagorean theorem (a² + b² = c²) applied to coordinates. Take two points (x₁, y₁) and (x₂, y₂):
That’s it. Memorize the Pythagorean theorem and you’ve memorized the distance formula. The squaring also means the order of subtraction doesn’t matter (negative squared = positive).
The midpoint is the average of the two endpoints — coordinate by coordinate. The x of the middle is the average of the two x-values; the y of the middle is the average of the two y-values:
That’s the same as taking the arithmetic mean of two numbers — applied separately to x and y.
Distance: d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5
Midpoint: M = ((1 + 4)/2, (2 + 6)/2) = (2.5, 4)
Distance: d = √((4 − (−3))² + (−1 − 5)²) = √(7² + (−6)²) = √(49 + 36) = √85 ≈ 9.22
Midpoint: M = ((−3 + 4)/2, (5 + (−1))/2) = (0.5, 2)
Same y means y₂ − y₁ = 0:
d = √((10 − 3)² + 0²) = √49 = 7 (just |x₂ − x₁|)
M = (6.5, 7)
“Midpoint of segment is (4, 6) and one endpoint is (1, 2). Find the other.”
M_x = (x₁ + x₂)/2 → 4 = (1 + x₂)/2 → x₂ = 7
M_y = (y₁ + y₂)/2 → 6 = (2 + y₂)/2 → y₂ = 10
Other endpoint: (7, 10)
Vertices A(0, 0), B(4, 0), C(2, 2√3 ≈ 3.464). Find all three sides:
AB = √((4−0)² + (0−0)²) = 4
BC = √((2−4)² + (3.464−0)²) = √(4 + 12) = √16 = 4
CA = √((0−2)² + (0−3.464)²) = √(4 + 12) = √16 = 4
All three = 4 ✓ → equilateral triangle.
For 3D points (x₁, y₁, z₁) and (x₂, y₂, z₂):
Same idea, just one more dimension. Example: P(1, 2, 3) and Q(4, 6, 8). Distance = √(9 + 16 + 25) = √50 ≈ 7.07; midpoint = (2.5, 4, 5.5).
For instant calculation use our Distance and Midpoint Calculator. For the related Section Formula (dividing a segment in any ratio, not just 1:1), see our Section Formula Calculator.
Are these formulas in the SAT/ACT/Class 10? Yes — both formulas are core curriculum in nearly every secondary geometry course worldwide. They’re heavily tested in the SAT Math, ACT, and India’s Class 10 board exams.
What if the points are in polar coordinates? Convert to rectangular first: x = r·cos(θ), y = r·sin(θ). Then apply the formulas as above. There’s a polar-distance formula but it’s messier.
Why is distance always positive? Squaring forces the differences to be positive (or zero), and the square root of a non-negative number is non-negative. Distance can never be negative — it’s a length, a magnitude.