Points that lie on a horizontal line share the same y-value. They would have coordinates that look something like this: (2,5) and (-4,5). More generally, two points that lie on a horizontal line could have coordinates (a,b) and (c,b).
If you can recognise that the points lie on a horizontal line then the distance between them is the distance between the x-values: the largest x-value minus the smallest x-value.
Points that lie on a vertical line share the same x-value. They would have coordinates that look something like this: (2,5) and (2,29). More generally, two points that lie on a vertical line could have coordinates (a,b) and (a,c).
If you can recognise that the points lie on a vertical line then the distance between them is the distance between the y-values: the largest y-value minus the smallest y-value.
What if we want to find the distance between two points that are not on a horizontal or vertical line?
We already learned how to use Pythagoras' theorem to calculate the side lengths in a right triangle.  Pythagoras' theorem states:
\begin{aligned} a^2+b^2 \quad &= \quad c^2\\\ \text{Shorter side lengths}\quad & \quad \quad \text{Hypotenuse} \end{aligned}
The value c is used to represent the hypotenuse which is the longest side of the triangle. The other two lengths are represented by a and b.
We can also use Pythagoras' theorem to find the distance between two points on an xy-plane. Let's see how by looking at an example.
The points A(-3,-2), B(-3,-4), and R(1,-4) are the vertices of a right-angled triangle, as shown on the number plane.
Find the length of interval AB.
Find the length of interval BC.
Use Pythagoras' theorem to find the length of the interval AC to three decimal places.
If the line is horizontal, the difference of the x-coordinates of the points is its distance.
If the line is vertical, the difference of the y-coordinates of the points is its distance.
Let's do the same thing now, but with any two general points A(x_1,y_1) and B(x_2,y_2).
Use Pythagoras' theorem to calculate the distance on the hypotenuse:
\displaystyle c^2 | \displaystyle = | \displaystyle (x_2-x_1)^2+(y_2-y_1)^2 |
\displaystyle c | \displaystyle = | \displaystyle \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} |
(where c is the distance between A and B)
What we have created here is called the distance formula.
We can use it to find the distance between any two points on the plane.
The following applet lets you explore distances between two points using the distance formula.
Move the endpoints and click \text{Reveal distance formula} and notice how the distance between two points is calculated.
The distance between two points is the square root of the sum of the squares of the run and the rise between the two points.
The distance between two points (x_1,y_1) and (x_2,y_2) is given by:
\displaystyle d | \displaystyle = | \displaystyle \sqrt{\text{run}^2+\text{rise}^2} |
\displaystyle d | \displaystyle = | \displaystyle \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} |
By convention, we choose (x_1,y_1) to be the left-most point, but as we are taking the square of the difference between the two values, it doesn't actually matter which one we choose. Either way we will get the same answer.
Find the distance between Point A(-2,-9) and Point B(2,-14), correct to two decimal places.
The distance between two points (x_1,y_1) and (x_2,y_2) is given by: