Yes, the ditance formula is derived from the pythagorean theorem. Pyth Theorem is a^2 + b^2 = c^2. In the distance formula c is the distance you are looking for, a is (x2 - x1) and b is (y2-y1). So after squaring a, b and taking the square root of the expression, you get the actual distance formula.