The first big formula of coordinate geometry tells us how far apart two points are.
Statement
The distance between P=(x1,y1) and Q=(x2,y2) is
PQ=(x2−x1)2+(y2−y1)2.
A special case: distance from the origin O=(0,0) to P=(x,y) is x2+y2.
Derivation
Drop perpendiculars from P and Q to the x-axis, meeting it at P′=(x1,0) and Q′=(x2,0). From P, drop a perpendicular to QQ′, meeting at R=(x2,y1). Then PRQ forms a right triangle with ∠R=90∘ (legs parallel to the axes).
PR=∣x2−x1∣ (horizontal distance).
QR=∣y2−y1∣ (vertical distance).
PQ is the hypotenuse.
By Pythagoras: PQ2=PR2+QR2=(x2−x1)2+(y2−y1)2. Take square roots. ■
(We use (x2−x1)2=(x1−x2)2, so the formula is symmetric in P and Q.)
Applications
The formula lets us test several geometric properties from coordinates alone.
Equality of distances (e.g., a point equidistant from two given points lies on the perpendicular bisector).
Identifying types of triangles: compute all three sides; if two are equal, isoceles; if all three, equilateral; if the Pythagorean relation holds, right.
Identifying quadrilaterals: compute all four sides and both diagonals; the combinations identify squares, rectangles, rhombi, parallelograms.
Verifying a point lies on a circle of given centre and radius (distance from centre equals radius).
The distance formula is robust against permutations: it doesn't matter which point you call "first".
Worked examples
Example 1. Find the distance between (3,−2) and (−1,4).
d=(−1−3)2+(4−(−2))2=16+36=52=213.
Example 2. Determine if the points (1,5),(2,3),(−2,−11) are collinear (using distances).