Since this format always works it can be turned into a formula. The distance formula is derived from the Pythagorean theorem. If the two points lie on the same horizontal or same vertical line the distance can be found by subtracting the coordinates that are not the same.
Here is the formula to find the distance between two points.
From the figure we have PR x2-x1 and QR y2-y1. PQ2 PR2 QR2 x2-x12 y2-y12 PQ. The length of the hypotenuse is the distance between the two points. More simply put it is the square root of.