Distance of a point from the line

To find the distance from a point to a line analytically, let us consider the following example.

Let us find the distance from point C to line AB.

background Layer 1 A B C D

Let point \(A\) of the line \(\overline{AB}\) be \((a_1,a_2,a_3)\), and point \(B\) be \((b_1,b_2,b_3)\). Let us find the distance from point \(C\), \((c_1,c_2,c_3)\), to this line.

In vector form, point \(A\) is \(\overrightarrow{a}=a_1\overrightarrow{i}+a_2\overrightarrow{j}+a_3\overrightarrow{k}\), point \(B\) is \(\overrightarrow{b}=b_1\overrightarrow{i}+b_2\overrightarrow{j}+b_3\overrightarrow{k}\), and point \(C\) is \(\overrightarrow{c}=c_1\overrightarrow{i}+c_2\overrightarrow{j}+c_3\overrightarrow{k}\).

Method 1: Finding the Distance Using the Cross Product

Let us take the cross product of the vectors \(\overrightarrow{AB}\) and \(\overrightarrow{AC}\).

The determinant of the matrix is calculated. This determinant is a vector.

The norm of the vector obtained from the cross product is then found: \(\left \|\overrightarrow{AC}x\overrightarrow{AB} \right \|\).

The norm of the line segment \(\overline{AB}\) is \(\left \|AB \right \|\).

This value gives the distance from point \(C\) to the line \(\overline{AB}\).

Example:

Let point \(A\) of the line \(\overline{AB}\) be \((1,3,-1)\), and point \(B\) be \((3,6,0)\). Let us find the distance from point \(C\), \((-2,4,-3)\), to this line.

In vector form, point \(A\) is \(\overrightarrow{a}=\overrightarrow{i}+3\overrightarrow{j}-\overrightarrow{k}\), point \(B\) is \(\overrightarrow{b}=3\overrightarrow{i}+6\overrightarrow{j}\), and point \(C\) is \(\overrightarrow{c}=-2\overrightarrow{i}+4\overrightarrow{j}-3\overrightarrow{k}\).

Let us take the cross product of the vectors \(\overrightarrow{AB}\) and \(\overrightarrow{AC}\).

This gives:

Method 2: Using an Arbitrary Point

Any point \(D\) on the line \(\overline{AB}\) can be written using the parameter \(t\) as follows.

The value of \(t\) is found by setting the dot product \(\overrightarrow{CD}\cdot \overrightarrow{AB}\) equal to zero. From this, point \(D\) is obtained. Then the length \(CD\) is calculated.

Example:

Substitute the calculated value of \(t\) into the equation.