In this article, we have jotted down various distance formulas. These formulas will help you to solve distance related problems easily. So, let us get started.

 

Distance Between Two Points in a Plane

Distance between two points A and B tells us the shortest distance between these two points. Two points A and B along with their coordinates are shown in the figure below:

 

Distance from a point to a line is the shortest distance between a line and point P. In the following figure, you can see a line r and point P. The shortest distance between point P and line r is depicted by a perpendicular line \overline {PM}.

d (P, r) = |\overrightarrow {PM}|
The formula for calculating the shortest distance between the point P and line r is given below:
d (P, r) = \frac {|A \cdot p_1 + B \cdot p_2 + C|} {\sqrt {A^2 + B^2}}
Consider the following example:
Calculate the distance between the line s having an equation 2x + 3y + 1 = 0 and point P (3, 5).
Use the following formula to compute the distance:
d (P, s) = \frac {|A \cdot p_1 + B \cdot p_2 + C|} {\sqrt {A^2 + B^2}}
Substitute the data in the above formula like this:
d (P, s) = \frac {|2 \cdot 3 + 3 \cdot 5 + 1|} {\sqrt {2^2 + 3^2}}
d (P, s) = \frac {|6 + 15 + 1|} {\sqrt {4 + 9}}
d (P, s) = \frac {22} {\sqrt {13}} \approx 6.101

Distance to the Origin in Plane

The formula for calculating the shortest distance between a line r and the origin O is given below:

d (O, r) = \frac {|C|} {\sqrt {A^2 + B^2}}

Consider the following example:

Calculate the distance between the line r whose equation is 2x + 5y + 2 = 0 and origin O.

Use the following formula to compute the distance between the line r and origin O.

d (O, r) = \frac {|C|} {\sqrt {A^2 + B^2}}

d (O, r) = \frac {|2|} {\sqrt {2^2 + 5^2}}

d (O, r) = \frac {|2|} {\sqrt {4 + 25}}

d (O, r) = \frac {2} {\sqrt {29}} \approx 0.37

 

Distance between Parallel Lines in a Plane

The distance between two parallel lines in a plane shows the shortest distance between two lines in a plane. The following figure shows two parallel lines r and s in a plane.

Distance between parallel lines in a plane
Suppose the equation of the line r is y = Ax + By + c_1 = 0 and the equation of the line 2 is y = Ax + By + c_2 = 0. The shortest distance between these lines can be calculated using the following formula:
d = \frac {|c_1 - c_2|} {\sqrt {A^2 + B^2}}

Consider the following example:

Calculate the distance between two parallel line r which has an equation 3x + 5y + 1 = 0 and line s which has an equation 3x + 5y + 7 = 0.

Use the following formula to compute the distance:

d = \frac {|c_1 - c_2|} {\sqrt {A^2 + B^2}}

Substitute the values in the formula like this:

d = \frac {|1- 7|} {\sqrt {3^2 + 5^2}}

d = \frac {|-6|} {\sqrt {9 + 25}}

d = \frac {6} {\sqrt {34}} \approx 1.029

 

Distance Between Two Points in a Space

The minimum distance between two points in a three dimensional space is calculated using the following formula:

d (A, B) = |\overrightarrow {AB}| = \sqrt {(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}

Consider the following example:

Calculate the distance between two point A (3, 4, 5) and B (7, 1, 4).

Use the following formula to calculate the distance:

d (A, B) = |\overrightarrow {AB}| = \sqrt {(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}

Substitute the values in the above formula:

d (A, B) = |\overrightarrow {AB}| = \sqrt {(7 - 3)^2 + (1 - 4)^2 + (4 - 5)^2}

d (A, B) = |\overrightarrow {AB}| = \sqrt {(4)^2 + (-3)^2 + (-1)^2}

d (A, B) = |\overrightarrow {AB}| = \sqrt {16 + 9 +1}

d (A, B) = |\overrightarrow {AB}| = \sqrt {26}

d (A, B) = |\overrightarrow {AB}| = 5.099

 

Point-Line Distance - Space

The distance from a point, P, to a line, r, tells us the minimum distance from the point to one of many points on the line.

Point - Line distance 3-Dimensional

The formula to compute the distance between a line r and the point P is given below:

d (P, r) = \frac {|\overrightarrow {u_r} \times \overrightarrow{AP}|}  {|\overrightarrow{u_r}|}

Here, \overrightarrow {u_r} reflects the direction vectors and \overrightarrow {AP} reflects the distance between the point P and point A on the line.

Consider the following example:

Determine the distance from the point P = (1 , 2, 5) to the line r = \begin{cases} x = 1 + 2t \\ y = 3 + t \\ z = 4 + t \end{cases}.First, we have to calculate \overrightarrow{u_r}.We need to treat each of the x = 1 + 2t, y = 3 + t, and z = 4 + t coefficients on the vector i, j, and k.

= (1 + 2t) i, (3 + t)j, ( 4 + t)k

= 1i + 2t i + 3j + tj + 4k, + tk

 

Now, we will make 2 groups. One group will contain all the values that have t and the other group will consist of all the values that do not have t like this:

= (i  + 3j + 4k) + (2ti + 1tj + 1tk)

Now, we will factor out t from the second group like this:

= 1 + 3j + 4k + t (2i +  1j + 1k)

The coefficients in the first group show the point from which the line passes through and the coefficients in the second group reflect the direction vectors.

Hence, the direction numbers for the line are \overrightarrow{u_r} =  (2, 1, 1) and the coordinates of the point through which the lines passes are \overrightarrow{A} = (1, 3, 4).

We have to calculate the distance between the point P (1 , 2, 5) and point on the line A (1, 3, 4).

Since have both A and P, hence we can easily calculate \overrightarrow{AP} like this:

\overrightarrow{AP} = (1 - 1, 2 - 3, 5 - 4) = (0, -1, 1)

Now, we will find the cross product of {u_r \times \overrightarrow{AP}} as shown below:

 

{u_r \times \overrightarrow{AP}} =\begin {bmatrix}  \overrightarrow {i}& \overrightarrow{j} & \overrightarrow{k} \\ 2 & 1 & 1 \\ 0 & -1 & 1 \\ \end {bmatrix} = 2\overrightarrow {i} - 2 \overrightarrow {j} - 2 \overrightarrow {k}

 

|{u_r \times \overrightarrow{AP}}| = \sqrt {(2)^2 + (-2)^2 + (-2)^2} = \sqrt{12}

u_r = (2, 1, 1)

|u_r| = \sqrt{2^2 + 1^2 + 1^2} = \sqrt{6}

 

Put these values in the following formula to get the distance:

d (P, r) = \frac {|\overrightarrow {u_r} \times \overrightarrow{AP}|} {|\overrightarrow{u_r}|}

d (P, r) = \frac {\sqrt{12}} {\sqrt{6}}

 

Distance between a Point and a Plane in a Space

The formula to calculate the distance between a point P and the plane \pi is given below:

d (P, \pi) = \frac { |Ax_o + By _o + Cz_o + D|} {\sqrt {A^2 + B^2 + C^2}}

Consider the following example:

Calculate the distance between a point P (3, 6, 7) and the plane \pi = 4x + 5y + 6z + 1 = 0

Use the following formula to calculate the distance:

d (P, \pi) = \frac { |Ax_o + By _o + Cz_o + D|} {\sqrt {A^2 + B^2 + C^2}}

Substitute the values in the above formula:

d (P, \pi) = \frac { |4(3) + 5(6) + 6(7) + 1|} {\sqrt {4^2 + 5^2 + 6^2}}

d (P, \pi) = \frac { |12 + 30 + 42 + 1|} {\sqrt {16 + 25 + 36}}

d (P, \pi) = \frac { |85|} {\sqrt {77}}

d (P, \pi) = \frac { 85} {\sqrt {77}} \approx 9.68

Need a Maths teacher?

Did you like the article?

1 Star2 Stars3 Stars4 Stars5 Stars 3.00/5 - 2 vote(s)
Loading...

Emma

I am passionate about travelling and currently live and work in Paris. I like to spend my time reading, gardening, running, learning languages and exploring new places.