∣AB∣=(x2−x1)2+(y2−y1)2 - Pythagoras with legs ∣x2−x1∣ and ∣y2−y1∣. Subtraction order never matters.
Special cases
Situation
Shortcut
Distance to origin
x2+y2
Horizontal segment (y1=y2)
∥x2−x1∥
Vertical segment (x1=x2)
∥y2−y1∥
Unknown coordinate procedure
Set formula equal to the given distance, square both sides, isolate the squared binomial, take ± roots - expect two answers. Classic integer triangles to recognize: 3-4-5, 5-12-13, 8-15-17.