Line in space.
Example. Let \(\mathbf{p},\mathbf{v}\in\mathbb{R}^n\setminus\{\mathbf{0}\}\). On the line $$ \mathbf{p}(t)=\mathbf{p}+t\mathbf{v},\quad t\in\mathbb{R}, $$ find the point closes to the origin.
Solution. The point is $$ \mathbf{p}(t_0) =\mathbf{p}-\frac{\mathbf{p}\cdot\mathbf{v}}{\mathbf{v}\cdot\mathbf{v}}\mathbf{v}. $$
Plane in space.
Example. Let \(\mathbf{p},\mathbf{v},\mathbf{u}\in\mathbb{R}^n\setminus\{\mathbf{0}\}\). Let \(\lVert\mathbf{v}\rVert=\lVert\mathbf{u}\rVert=1\) and \(\mathbf{u}\not\parallel\mathbf{v}\), that is, \(\mathbf{u}\cdot\mathbf{v}\lt 1\). Consider the plane $$ \mathbf{p}(s,t)=\mathbf{p}+s\mathbf{u}+t\mathbf{v},\quad s,t\in\mathbf{R}. $$ Claim. The point $$ \mathbf{p}(s_0,t_0) =\mathbf{p} +\frac{(\mathbf{u}\cdot\mathbf{v})(\mathbf{p}\cdot\mathbf{v})-(\mathbf{p}\cdot\mathbf{u})} {1-(\mathbf{u}\cdot\mathbf{v})^2}\mathbf{u} +\frac{(\mathbf{u}\cdot\mathbf{v})(\mathbf{p}\cdot\mathbf{u})-(\mathbf{p}\cdot\mathbf{v})} {1-(\mathbf{u}\cdot\mathbf{v})^2}\mathbf{v} $$ is closest to the origin.
Let's prove the claim by showing that \(\mathbf{p}(s_0,t_0)\cdot\mathbf{u}=0=\mathbf{p}(s_0,t_0)\cdot\mathbf{v}.\)
For \(\mathbf{p}(s_0,t_0)\cdot\mathbf{u}\) we obtain $$ \mathbf{p}\cdot\mathbf{u} +\frac{(\mathbf{u}\cdot\mathbf{v})(\mathbf{p}\cdot\mathbf{v})-(\mathbf{p}\cdot\mathbf{u})} {1-(\mathbf{u}\cdot\mathbf{v})^2} +\frac{(\mathbf{u}\cdot\mathbf{v})(\mathbf{p}\cdot\mathbf{u})-(\mathbf{p}\cdot\mathbf{v})} {1-(\mathbf{u}\cdot\mathbf{v})^2}(\mathbf{u}\cdot\mathbf{v}). $$ Here we used \(\mathbf{u}\cdot\mathbf{u}=0\) and the commutativity of the dot product. Set $$ a=\mathbf{p}\cdot\mathbf{u},\quad b=\mathbf{p}\cdot\mathbf{v},\quad c=\mathbf{u}\cdot\mathbf{v}, $$ then we obtain $$ a+\frac{cb-a}{1-c^2}+\frac{ca-b}{1-c^2}c. $$ This simplifies to $$ \frac{a-ac^2+cb-a+c^2a-bc}{1-c^2}=0. $$ Thus \(\mathbf{p}(s_0,t_0)\cdot\mathbf{u}=0\). The equation \(\mathbf{p}(s_0,t_0)\cdot\mathbf{v}=0\) is proved in a similar fashion.
On the other hand, the second dot product is clearly zero. Namely, the formula of \(\mathbf{p}(s_0,t_0)\) is symmetric with respect to \(\mathbf{u}\) and \(\mathbf{v}\): if they are interchanged, the formula will not change.
An equation of a plane easily yields the point closest to the origin.
Next, consider two lines. If the lines are in the same plane, they will be parallel or intersect each other.
In space \(\mathbb{R}^n\), with \(n\geq 3\), the situation is more complex. Two lines \(L_1\) and \(L_2\) can
(i) | intersect; | |
(ii) | be parallel; | |
(iii) | be non-parallel and have a minimum distance \(d_0\) from each other. |
There are formulas for \(\mathbf{p}_0\) and \(\mathbf{q}_0\). Solution is almost as in the previous example.
Example. Let \(\mathbf{p},\mathbf{q},\mathbf{u},\mathbf{v}\in\mathbb{R}^n\). Let \(\lVert\mathbf{v}\rVert=\lVert\mathbf{u}\rVert=1\) and \(\mathbf{u}\not\parallel\mathbf{v}\), that is, \(\mathbf{u}\cdot\mathbf{v}\lt 1\). Consider the lines $$ L_1:\quad \mathbf{p}(t)=\mathbf{p}+t\mathbf{v},\quad t\in\mathbb{R}, $$ and $$ L_2:\quad \mathbf{q}(s)=\mathbf{q}-s\mathbf{u},\quad s\in\mathbb{R}. $$ Let \(d(L_1,L_2)=d_0\).
Claim. . The points \(\mathbf{p}(t_0)\in L_1\) and \(\mathbf{q}(s_0)\in L_2\) with \(d(L_1,L_2)=d_0=d(\mathbf{p}(t_0),\mathbf{q}(s_0))\) satisfy the formulas $$ \mathbf{p}(t_0)=\mathbf{p}+\frac{(\mathbf{w}\cdot\mathbf{v})-(\mathbf{u}\cdot\mathbf{v})(\mathbf{w}\cdot\mathbf{u})}{1-(\mathbf{u}\cdot\mathbf{v})^2}\mathbf{v} $$ and $$ \mathbf{q}(s_0)=\mathbf{q}+\frac{(\mathbf{w}\cdot\mathbf{u})-(\mathbf{u}\cdot\mathbf{v})(\mathbf{w}\cdot\mathbf{v})}{1-(\mathbf{u}\cdot\mathbf{v})^2}\mathbf{u}, $$ where \(\mathbf{w}=\mathbf{p}-\mathbf{q}\).
The claim is equivalent to $$ (\mathbf{p}(t_0)-\mathbf{q}(s_0))\cdot\mathbf{u}=0=(\mathbf{p}(t_0)-\mathbf{q}(s_0))\cdot\mathbf{v}. $$ The claim holds if and only if $$ \mathbf{p}(t_0)\cdot\mathbf{u}=\mathbf{q}(s_0)\cdot\mathbf{u} \quad\textrm{and}\quad \mathbf{p}(t_0)\cdot\mathbf{v}=\mathbf{q}(s_0)\cdot\mathbf{v}. $$ Checking this is a straight-forward calculation.
Consider the intersection line of two planes. On that intersection line, we can find the point closest to the origin.
Example. Let \(\mathbf{q}_1,\mathbf{q}_2,\mathbf{n}_1,\mathbf{n}_2\in\mathbb{R}^n\). Let \(\lVert\mathbf{n}_1\rVert=\lVert\mathbf{n}_2\rVert=1\) and \(\mathbf{n}_1\not\parallel\mathbf{n}_2\), that is, \(\mathbf{n}_1\cdot\mathbf{n}_2\lt 1\). Consider the planes $$ T_1:\quad (\mathbf{x}-\mathbf{q}_1)\cdot\mathbf{n}_1=0 $$ and $$ T_2:\quad (\mathbf{x}-\mathbf{q}_2)\cdot\mathbf{n}_2=0. $$ Thus, plane \(T_j\) passes through points \(q_j\) and the plane \(T_j\) has a normal \(n_j\). Because the planes are not parallel, they have an intersection line.
Claim. On the intersection line, the point closest to the origin is $$ \mathbf{p} =\frac{(\mathbf{q_1}\cdot\mathbf{n}_1)-(\mathbf{n}_1\cdot\mathbf{n}_2)(\mathbf{q_2}\cdot\mathbf{n}_2)}{1-(\mathbf{n}_1\cdot\mathbf{n}_2)^2}\mathbf{n}_1 +\frac{(\mathbf{q_2}\cdot\mathbf{n}_2)-(\mathbf{n}_1\cdot\mathbf{n}_2)(\mathbf{q_1}\cdot\mathbf{n}_1)}{1-(\mathbf{n}_1\cdot\mathbf{n}_2)^2}\mathbf{n}_2 $$
The claim follows from two facts.
First, the vector \(\mathbf{p}\) can be perpendicular to the intersection line only if it is a plane, which passes through the origin and parallel to \(\mathbf{n}_1\) and \(\mathbf{n}_2\). Thus, $$ \mathbf{p}=a\mathbf{n}_1+b\mathbf{n}_2 $$ for some \(a,b\in\mathbb{R}\).
Second, the point \(\mathbf{p}\) must lie on both of the planes. Thus, $$ (\mathbf{p}-\mathbf{q}_j)\cdot\mathbf{n}_j=0 \quad\textrm{that is}\quad \mathbf{p}\cdot\mathbf{n}_j=\mathbf{q}_j\cdot\mathbf{n}_j $$ for \(j=1,2\).
Let's start with a simple example.
Perpendicular vectors are as easy to find in \(\mathbb{R}^n\), where \(n\geq 3\). However, we are not interested on the zero vector \(\mathbf{0}\). Thus, we need to give vectors \(\mathbf{n}_j\), where \(j\in\{1,2,\ldots,n+1\}\). On these vectors, \(\mathbf{n}_j\) at most two are the same. That means, at most one is the zero vector.