Could someone explain, in easy terms, how the Pythagorean theorem and the distance formula are related? I know the formulas for both of them, and I know how to plug in numbers to use both of them, but I am not seeing the relationship between the two.

Thank you.

consider a right triangle with legs parallel to the x- and y-axes.

The length of the horizontal leg is a = (x2-x1)
The length of the vertical leg is b = (y2-y1)
The distance formula/Pythagorean Theorem gives you the length of the diagonal distance (hypotenuse) between the two points.

a^2 + b^2 = (x2-x1)^2 + (y2-y1)^2 = c^2