Given the two points x1 y1 and x2 y2 the distance d between these points is given by the formula. Since this format always works it can be turned into a formula. Given the coordinates of two points the distance D between the points is given by.
The shortest path distance is a straight line.
If two points have the same y -coordinate then the segment connected them is horizontal. For example if A A and B B are two points and if AB 10 A B 10 cm it means that the distance between A A and B B is 10 10 cm. The distance between any two points is the length of the line segment joining the points. Simply subtract their x-coordinates to find the length of the segment between them.