Distance Formula

  • Introduction
  • What is Distance in Mathematics?
  • What is the Distance Formula?
  • Distance Between `2` points in a Two-Dimensional `(2D)` plane
  • Distance Between `2` Points in a Three-Dimensional `(3D)` plane
  • Distance between Point and Origin in `3D`
  • Distance between a Point and a Line in `2D`
  • Solved Examples
  • Practice Problems
  • Frequently Asked Questions

 

Introduction

Everybody travels on a daily basis to some location, and throughout this travel, they cover a certain distance. Math can help us calculate the distance between two points. In this article,  we will calculate the distance using the distance formula, and many more.

 

What is Distance in Mathematics?

The length of a line connecting two points indicates the distance between the two points. If the two points are on a vertical or horizontal line, the distance can be determined by subtracting the non-identical coordinates.

The distance formula is used in analytic geometry to calculate the distance between two lines, the perimeter and area of polygons on a coordinate plane, and many other things. For example, we can use the distance formula to determine if a triangle is scalene, isosceles, or equilateral by determining the lengths of its sides.
 

What is the Distance Formula?

The distance between `2` points `P_1` and `P_2` is represented as `|P_1P_2|`. The distance formula can be used to calculate the distance between two points. The distance formula depends on the dimension of the space where the two points are placed. 

Distance between `2` points

For `2D: d= \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2}`

For `3D: d=  \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2 + (z_1 - z_0)^2}`

For `4D: d=  \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2 + (z_1 - z_0)^2 + (a_1 - a_0)^2}`

For `nD: d=  \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2 + (z_1 - z_0)^2 + (a_1 - a_0)^2 + \ldots}`

Distance Between `2` points in a Two-Dimensional `(2D)` Plane 

Distance Formula

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

`d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}`

The distance formula is derived from the Pythagorean Theorem.

Example: Find the distance between the points `(3,2)` and `(5,7)`?


Solution:

\(\begin{align*}
d &=  \sqrt{(7 - 3)^2 + (5 - 2)^2} \\
&=  \sqrt{4^2 + 3^2} \\
&=  \sqrt{16 + 9} \\
&=  \sqrt{25} \\
&= 5
\end{align*}\)

Distance Between `2` points in a Three-Dimensional `(3D)` Plane

Consider two points on a `3D` plane, `A (x_1,y_1, z_1)` and `B(x_2,y_2, z_2)`. Below is the formula for calculating the distance between two points.

Example: Find the distance between the points `P(2, 3, 1)` and `Q(-3, 4,2)`.

Solution: Plugging into the distance formula:

\(\begin{align*}
d &=  \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \\
&=  \sqrt{(-3 - 2)^2 + (4 - 3)^2 + (2 - 1)^2} \\
&=  \sqrt{(-5)^2 + (1)^2 + (1)^2} \\
&=  \sqrt{25 + 1 + 1} \\
&=  \sqrt{27}\\ &\approx 5.2
\end{align*}\)

Distance Between Point and Origin in `3D`

Consider two points on a `3D` plane, `P (x,y,z)` and `O (0,0,0)`. We can apply the distance formula as shown below:

Distance between a Point and a Line in `2D`

Consider a point `P (x_0,y_0)` and a line `Ax + By + C = 0`. The formula for calculating the distance between the point and the line is as follows:

`d = \frac{|Ax_0 + By_0 + C|}{\sqrt{A^2 + B^2}}`

Example: Find the distance of point `A(5, 2)` from the line `3x + 4y + 5 = 0`.

Solution: The distance of point `A(5, 2)` from the line `3x + 4y + 5 = 0` is

\(\begin{align*}
d &= \frac{\left|3 \times 5 + 4 \times 2 + 5\right|}{\sqrt{3^2 + 4^2}} \\
&= \frac{\left|15 + 8 + 5\right|}{\sqrt{9 + 16}} \\
&= \frac{28}{\sqrt{25}} \\
&= \frac{28}{5} \\
&= 5.6
\end{align*}\)

Solved Examples

Example`1`: Calculate the distance between the following points:

  1. `(-4, 5)` and `(5, 3)`
  2. `(3, 5, –1)` and `(0, 2, 5)`

Solution:

a. Let d be the distance between the two points `(-4, 5)` and `(5, 3)`.

\(\begin{aligned}
   d &= \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \\
   &= \sqrt{(5 - (-4))^2 + (3 - 5)^2} \\
   &= \sqrt{(9)^2 + (-2)^2} \\
   &= \sqrt{81 + 4} \\
   &= \sqrt{85}\\&\approx 9.2
\end{aligned}\)

 

b. Let `d` be the distance between the two points `(3, 5, –1)` and `(0, 2, 5)`.

\(\begin{aligned}
   d &= \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \\
   &= \sqrt{(0 - 3)^2 + (2 - 5)^2 + (5 - (-1))^2} \\
   &= \sqrt{(-3)^2 + (-3)^2 + (6)^2} \\
   &= \sqrt{9 + 9 + 36} \\
   &= \sqrt{54} \\
   &\approx 7.3
\end{aligned}\)

Example `2`: Calculate the distance between the `P(5,12)` and line `3x + 4y + 5 =0`.

Solution: 

Let `d` be the distance between the point and the line.

\(\begin{aligned}
   d &= \frac{\left|Ax_0 + By_0 + C\right|}{\sqrt{A^2 + B^2}} \\
   &= \frac{\left|3 \times 5 + 4 \times 12 + 5\right|}{\sqrt{3^2 + 4^2}} \\
   &= \frac{\left|15 + 48 + 5\right|}{\sqrt{9 + 16}} \\
   &= \frac{68}{\sqrt{25}} \\
   &= \frac{68}{5} \\
   &= 13.6
\end{aligned}\)

Practice Problems:

Q`1`. What is the distance of the point `(4,3)` from the origin.

  1. `5`
  2. `4`
  3. `3`
  4. None of these

Answer: a

 

Q`2`. What is the distance of the line `12x + 5y + 9 = 0`  from the origin.

  1. `0.92`
  2. `0.69`
  3. `0`
  4. None of these

Answer: b

 

Frequently Asked Questions:

Q`1`: What do you mean by distance in Maths?

Answer: The distance between two points is the length of the line segment joining the two given points.

 

Q`2`: Is distance a scalar quantity or a vector quantity?

Answer: Distance is a scalar quantity as it does not depend on the direction.

 

Q`3`: Can the distance between `2` points be negative?

Answer: No, the distance value is always positive.

 

Q`4`: How can we find the distance between two points `(x_1,y_1)` and `(x_2,y_2)`.

Answer: The distance between two points `(x_1,y_1)` and `(x_2,y_2)` can be calculated using the distance formula. 
`d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}`
Plug in the value of the coordinates `x_1, y_1, x_2` and `y_2` in the distance formula to find `d`.

 

Q`5`: Where do we use distance formula in real life?

Answer: Distance formula has various applications in real life. It is used in navigation system to help pilots measure distance between their plane and other planes. Sailors also use distance formula while navigating their ships. Interior designers, architects, etc. use distance formula for finding length of buildings, home appliances, etc.