You can
put this solution on YOUR website!
Suppose we want to find the distance d = AB from point A(x1,y1) to point B(x2,y2).
We draw in a green line and a red line to form a right triangle:
By the Pythagorean theorem:
d² = (green line)² + (red line)²
The length of the green line is x2 - x1.
The length of the red line is y2 - y1
So
d² = (x2 - x1)² + (y2 - y1)²
Therefore:
______________________
d = V(x2 - x1)² + (y2 - y1)²
Edwin