4.4. Shortest distance problems#
We can take advantage of vector geometry to calculate the solutions to shortest distance problems.
4.4.1. Shortest distance between two points#
In \(\mathbb{R}^n\) the shortest distance, \(d\), between two points with position vectors \(\vec{p}=(p_1, p_2, \ldots, p_n)\) and \(\vec{q} = (q_1, q_2, \ldots, q_n)\) is the length of a straight line segment connecting them. If we think about this segment as of a vector, then
Note that \(\|\vec{p} - \vec{q}\| = \|\vec{q} - \vec{p}\|\).
4.4.2. Shortest distance between a line and a point#
To the shortest distance, \(d\), between a line \(\vec{r} = \vec{p} + t\vec{d}\) and a point with position vector \(\vec{q}\) in \(\mathbb{R}^n\) is the length of the vector \(\vec{q} - \vec{r}\) which is perpendicular to \(\vec{d}\) (Fig. 4.10).
Since \(\vec{q} - \vec{r}\) is perpendicular to \(\vec{d}\) then since the dot product between two perpendicular vectors is zero then
Substituting the vector equation of a line and rearranging to make \(t\) the subject gives
This gives the value of the parameter \(t\) that can be used to calculate the position vector \(\vec{r}\) and therefore the shortest distance between the point \(\vec{q}\) and the line is \(\|\vec{q} - \vec{r}\|\)[1].
(The shortest distance between a point and a line)
The shortest distance between the point with position vector \(\vec{q}\) and a line that passes through the point with position vector \(\vec{p}\) in the direction \(\vec{d}\) is \(\|\vec{q} - \vec{r}\|\) where \(\vec{r} = \vec{p} + t \vec{d}\) and
Find the shortest distance between the point with position vector \(\vec{q} = (2,2,2)\) and the line \((t,t-2, t+1)\).
Solution
Writing the line in the form \(\vec{r} = \vec{p} + t \vec{d}\)
so the direction vector is \(\vec{d} = (1, 1, 1)\). Using equation (4.3)
So the point on the line which is closest to \(\vec{q}\) is
and the shortest distance is \(\|\vec{q} - \vec{r}\|\) so
4.4.3. Shortest distance between two lines#
Given two lines \(\ell_1\) and \(\ell_2\) described by \(\vec{r}_1 = \vec{p}_1 + t \vec{d}_1\) and \(\vec{r}_2 = \vec{p}_2 + t \vec{d}_2\) in \(\mathbb{R}^n\) we have three situations to consider
If the two lines intersect then obviously the shortest distance is obviously 0.
If the two lines are parallel then any point on \(\ell_1\) can gives the shortest distance between \(\ell_1\) and \(\ell_2\). Hence we simply choose a point on \(\ell_2\) and apply method for finding the distance between a point and a line.
If the two lines are skew then the shortest distance is the distance of the chord that is perpendicular to both \(\ell_1\) and \(\ell_2\) (Fig. 4.11).
If \(\vec{r}_1\) and \(\vec{r}_2\) are points on the lines \(\ell_1\) and \(\ell_2\) respectively then the chord \(\vec{r}_1 \to \vec{r}_2\) which is perpendicular to both lines has the direction vector \(\vec{n} = \vec{d}_1 \times \vec{d}_2\). If \(d\) is the distance between \(\vec{r}_1\) and \(\vec{r}_2\) then
Let \(\hat{\vec{n}} = \dfrac{\vec{d}_1 \times \vec{d}_2}{\|\vec{d}_1 \times \vec{d}_2\|}\) and substituting the equations of \(\vec{r}_1\) and \(\vec{r}_2\) equation (4.4) gives
Since \(\vec{n}\) is perpendicular to both \(\ell_1\) and \(\ell_2\) then \(\vec{d}_1 \cdot \vec{n} = \vec{d}_2 \cdot \vec{n} = 0\) and \(\hat{\vec{n}} \cdot \hat{\vec{n}} = 1\) then
which simplifies to
(The shortest distance between two skew lines)
The shortest distance between two skew lines \(\vec{r}_1 = \vec{p}_1 + t_1 \vec{d}_1\) and \(\vec{r}_2 = \vec{p}_2 + t_2 \vec{d}_2\) is
where \(\hat{\vec{n}} = \dfrac{\vec{d}_1 \times \vec{d}_2}{\|\vec{d}_1 \times \vec{d}_2\|}\).
Find the shortest distance between the two skew lines \(\ell_1\) and \(\ell_2\) defined by \((t_1, 1 + 4t_1, 3 + 2 t_1)\) and \((1, 1 + 2t_2, 3 + 4t_2)\) respectively.
Solution
First, we need to identify the direction vectors \(\vec{d}_1\) and \(\vec{d}_2\). Writing \(\ell_1\) and \(\ell_2\) in the form \(\vec{r} = \vec{p} + t \vec{d}\)
therefore \(\vec{d}_1 = (1, 4, 2)\) and \(\vec{d}_2 = (0, 2, 4)\). Now we can calculate \(\hat{\vec{n}}\)
Note that since \(\vec{n}\) is non-zero, \(\ell_1\) and \(\ell_2\) are skew lines. Using equation (4.5)