topic badge
AustraliaNSW
Stage 5.1-3

3.03 The distance between two points

Lesson

Distances on the cartesian plane

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.

Examples

Example 1

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.

-3
-2
-1
1
2
x
-4
-3
-2
-1
1
2
y
a

Find the length of interval AB.

Worked Solution
Create a strategy

Since the interval is vertical, subtract the smaller y-coordinate from the larger y-coordinate.

Apply the idea
\displaystyle AB\displaystyle =\displaystyle -2-(-4)Subtract -4 from -2
\displaystyle =\displaystyle -2+4Evaluate the adjacent signs
\displaystyle =\displaystyle 2 \text{ units}Evaluate
b

Find the length of interval BC.

Worked Solution
Create a strategy

Since the interval is horizontal, subtract the smaller x-coordinate from the larger x-coordinate.

Apply the idea
\displaystyle BC\displaystyle =\displaystyle 1-(-3)Subtract -3 from 1
\displaystyle =\displaystyle 1+3Evaluate the adjacent signs
\displaystyle =\displaystyle 4 \text{ units}Evaluate
c

Use Pythagoras' theorem to find the length of the interval AC to three decimal places.

Worked Solution
Create a strategy

Let the values found from parts (a) and (b) as the shorter side lengths.

Apply the idea

Let the length of AC denoted by c.

\displaystyle c^2\displaystyle =\displaystyle a^2+b^2Use the Pythagoras' theorem
\displaystyle c^2\displaystyle =\displaystyle (2)^2+(4)^2Substitute a=2 and b=4
\displaystyle c^2\displaystyle =\displaystyle 4+16Evaluate the exponents
\displaystyle c^2\displaystyle =\displaystyle 25Evaluate the addition
\displaystyle \sqrt{c^2}\displaystyle =\displaystyle \sqrt{20}Take the square root of both sides
\displaystyle c\displaystyle =\displaystyle 4.472Evaluate

Since AC is denoted by c, the length of AC is 4.472 units.

Idea summary

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.

1
2
3
4
5
x
1
2
3
4
5
y

We can use the Pythagoras' theorem to find the distance between two points, by drawing a right-angled triangle to find the shorter side lengths. Then the hypotenuse will be the distance between the two points.

Distance formula

Let's do the same thing now, but with any two general points A(x_1,y_1) and B(x_2,y_2).

Points A and B on a cartesian plane. Ask your teacher for more information.

Sketch them on an xy-plane. (We don't know where these points are so we can represent them like this).

Points A and B on a cartesian plane connected by a right angled triangle. Ask your teacher for more information.

Draw a right triangle connecting the two points like this.

Points A and B on a cartesian plane connected by a right angled triangle. Ask your teacher for more information.

On the diagram mark the horizontal and vertical distances (calculate them like we did above). These are two of the side lengths of the right-angled triangle.

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.

Exploration

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.

Loading interactive...

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.

Examples

Example 2

Find the distance between Point A(-2,-9) and Point B(2,-14), correct to two decimal places.

Worked Solution
Create a strategy

Determine the coordinates, then use the distance formula.

Apply the idea

The coordinates are A(-2,-9) and B(2,-14).

\displaystyle AB\displaystyle =\displaystyle \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}Use the distance formula
\displaystyle =\displaystyle \sqrt{(2-(-2))^2+(-14-(-9)^2}Substitute (x_1,y_1)=(-2,-9),\,(x_2,y_2)=(2,-14)
\displaystyle =\displaystyle \sqrt{4^2+(-5)^2}Evaluate the parentheses
\displaystyle =\displaystyle \sqrt{16+25}Evaluate the exponents
\displaystyle =\displaystyle \sqrt{41}Evaluate the addition
\displaystyle =\displaystyle 6.40 \text{ units}Evaluate and round
Idea summary

The distance between two points (x_1,y_1) and (x_2,y_2) is given by:

\displaystyle d=\sqrt{(x_2-x_1)^2+(x_2-x_1)^2}
\bm{d}
is the distance between two points
\bm{(x_1,y_1)}
are the coordinates of the first point
\bm{(x_2,y_2)}
are the coordinates of the second point

Outcomes

MA5.3-8NA

uses formulas to find midpoint, gradient and distance on the Cartesian plane, and applies standard forms of the equation of a straight line

What is Mathspace

About Mathspace