How the distance formula calculator works
The straight-line distance between two points looks like a new formula to memorize, but it's a theorem you already know wearing a disguise. Slide from point 1 to point 2 and you can always break the trip into two moves: go sideways by Δx = x₂ − x₁, then straight up or down by Δy = y₂ − y₁. Those two moves are the legs of a right triangle, and the direct diagonal path — the distance you want — is its hypotenuse. Pythagoras handles the rest: square the legs, add, take the root.
The formula
d is the distance, (x₁, y₁) and (x₂, y₂) are your two points, and the differences Δx and Δy are the triangle's legs. Because both differences are squared, the order of the points doesn't matter and the result can never be negative.
Worked example
Take the points (0, 0) and (3, 4):
Δx = 3 − 0 = 3 and Δy = 4 − 0 = 4
d = √(3² + 4²) = √(9 + 16) = √25 = 5
This is the famous 3-4-5 right triangle — legs of 3 and 4, hypotenuse of exactly 5. It's the smallest right triangle with all whole-number sides, which is why math teachers reach for it constantly. The midpoint of the trip, for the record, sits at (1.5, 2).
Why d² is sometimes more useful than d
Notice the calculator also reports the distance squared. That's not padding — in a lot of real work, d² is the number you actually want. Square roots are irrational for most inputs (√2, √5, √13...), but the squared distance of integer coordinates is always a clean integer. And if you're only comparing distances — which point is closest? — comparing squared distances gives the same answer while skipping the square root entirely, which is exactly what game engines and mapping software do millions of times per second. Take the root only when you need the distance itself, in actual units.