Given the points A(x1, y1) and B(x2, y2). The distance between these 2 points can be calculated as below;
DistAB = (x2-x1)2+(y2-y1)2
This formula is obtained from the graph below as shown
Y2
B(x2, y2)
y1
A(x1, y1)
x1 x2
Using Pythagoras‘ theorem, (AB)2 = (x2 – x1)2 + (y2 – y1)2, therefore AB = (x2-x1)2+(y2-y1)2
Ex: find the distance between the points A(1, 3) and B(5, 2)
Solution:
DistAB = (x2-x1)2+(y2-y1)2 = (5-1)2+(2-3)2 = 17 units