Karl M. answered 08/17/22
Experienced, Highly Rated Undergraduate Math and Physics Tutor
For any two points P=(x1, y1) and Q=(x2,y2), the distance d between P and Q in the plane is given by the distance formula:
d = √[ (x2 - x1)2 + (y2 - y1)2 ].
If this looks familiar to you as some kind of application of the Pythagorean Theorem (a2 + b2 = c2), great job, it is! We can draw a right triangle between the two points whose horizontal side is the x distance between the points (x2 - x1) and whose vertical side is the y distance between the points (y2 - y1). The straight line distance between the points is just the hypotenuse of that triangle!
Of note, it doesn't matter which point you assign to be (x1, y1) or (x2, y2).
An example:
P=(-1, 1), Q=(3,-2)
d = √[ (3 - (-1))2 + (-2 - 1)2 ]
d = √[ (4)2 + (-3)2 ]
d = √[ 16 + 9 ]
d = √[ 25 ]
d = 5
Whenever doing square roots, it's important to remember plus-or-minus, but because we're doing lengths, we only take the positive value since negative lengths don't make much sense in this case.