How to Calculate the Distance Between Two Points?

By Robert O

It is easy to calculate the distance between two points by applying the Pythagoras theorem. Using the coordinates of the two points, you can calculate both the vertical and horizontal distances. You can then calculate the diagonal of the right-angled triangle formed.

Consider two point A(x1, y2) and B(x2, y2) on a Cartesian plane as shown below:

 

Graph generated from https://www.desmos.com/

 

The horizontal distance, H, is:

    \[|(x 2-x 1)|\]

The vertical distance, V, is:

    \[\left|\left(y^{2}-y 1\right)\right|\]

By applying Pythagoras Theorem, we can calculate the distance between points A and B as follows:

The distance between point A and B =

    \[\sqrt{|(x 2-x 1)|^{2}+|(y 2-y 1)|^{2}}\]

Let’s use some examples to better explain how the formula works.

Example 1

What is the distance between points A(4, 6) and B(1, 4)?

Solution

This is the representation of these points on a Cartesian plane.

Graph generated from https://www.desmos.com/

 

The horizontal distance,

    \[H=(4-1)=3\]

The vertical distance,

    \[V=(6-4)=2\]

The distance between point A and B =

    \[\sqrt{|(x 2-x 1)|^{2}+|(y 2-y 1)|^{2}}\]

    \[=\sqrt{|3|^{2}+|2|^{2}}\]

    \[=3.464 \text { units }\]

Example 2

Calculate the distance between the points A(-4, 2) and B(1, 4)?

Solution

Plotting the points on a Cartesian plane gives:

Graph generated from https://www.desmos.com/

The distance between point A and B =

    \[=\sqrt{|(x-x 1)|^{2}+|(y 2-y 1)|^{2}}\]

    \[=\sqrt{|1-(-4)|^{2}+|4-2|^{2}}\]

    \[=\sqrt{|5|^{2}+|2|^{2}}\]

    \[=5.39 \text { units }\]

Example 3

What is the distance between the points (10, -5) and (-5, 3)?

Solution

We can still find the distance between the points without having to plot them on a graph.

The distance between the points,

    \[d=\sqrt{|(x-x 1)|^{2}+|(y 2-y 1)|^{2}}\]

    \[=\sqrt{|10-(-5)|^{2}+|(-5)-2|^{2}}\]

    \[=\sqrt{|15|^{2}+|-7|^{2}}\]

    \[=16.55 \text { units }\]

Remarks

By just using the formula, you can calculate the distance of any two points on a Cartesian plane if you have the coordinates. We just apply the Pythagoras Theorem to find the distance.

About the Author

This lesson was prepared by Robert O. He holds a Bachelor of Engineering (B.Eng.) degree in Electrical and electronics engineering. He is a career teacher and headed the department of languages and assumed various leadership roles. He writes for Full Potential Learning Academy.