Drag either point. A right triangle appears between them — one leg across, one leg up, and the straight line joining them as the hypotenuse. The distance formula is just Pythagoras on that triangle.
Drag point A or point BThe legs are the differences in x and in yTry crossing into negative coordinates
Examples
The two points
Point A
(3, 4)
Point B
(7, 1)
Across (x₂−x₁)
4
Up (y₂−y₁)
-3
A leg can come out negative, and it does not matter — squaring removes the sign. That is why the formula works in every quadrant.
The working
Step 1 · square the legs
4² + 3² = 16 + 9
Step 2 · add them
= 25
Step 3 · take the square root
AB = 5.00
Show
Turn on the squares. The two small squares together always cover exactly the same area as the big one on the sloping side — that is the theorem, drawn.