The Pythagorean theorem states that for any right triangle, the square of the hypotenuse is equal to the sum of the squares of the two legs. The distance formula calculates the distance between two points by taking the square root of the sum of the squares of the differences between their x- and y-coordinates. An example shows using the distance formula to find the distance between points (4,9) and (16,3), which equals 12.94.