Points closest to origin



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.

Example. Consider the plane $$ ax+by+cz=d, $$ with normal \(\mathbf{n}=(a,b,c)\). The normal cannot be a zero vector, thus $$ \lVert\mathbf{n}\rVert=\sqrt{a^2+b^2+c^2}\neq 0. $$ The point on the plane, closest to the origin, is $$ \mathbf{p}=\frac{d}{\mathbf{n}\cdot\mathbf{n}}\mathbf{n}. $$ Namely, \(\mathbf{p}\cdot\mathbf{n}=d\) shows that \(\mathbf{p}\) is on the plane. On the other hand, \(\mathbf{p}\) is on the line throught the origin $$ \mathbf{q}(t)=t\mathbf{n},\quad t\in\mathbb{R}, $$ and therefore the segment from the origin to \(\mathbf{p}\) is perpendicular to the plane.

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.
In case (iii), there are unique points \(\mathbf{p}_0\in L_1\) and \(\mathbf{q}_0\in L_1\), for which \(d(\mathbf{p}_0,\mathbf{q}_0)=d_0\).

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\).


Finding perpendicular vectors

Let's start with a simple example.

Example. Let \(\mathbf{u}=(a,b)\) be given. Then \(\mathbf{v}=(b,-a)\) satisfies \(\mathbf{u}\perp\mathbf{v}\). Namely $$ \mathbf{u}\cdot\mathbf{v}=(a,b)\cdot(b,-a)=ab-ba=0. $$

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.

Example. Let \(\mathbf{u}=(a,b,c)\in\mathbf{R}^3\setminus\{\mathbf{0}\}\) be given. Then the vectors $$ \mathbf{v}_1=(b-c,c-a,a-b) $$ and $$ \mathbf{v}_2=(-(b-c),c-(-a),(-a)-b)=(-b+c,c+a,-a-b) $$ and $$ \mathbf{v}_3=((-b)-c,-(c-a),a-(-b))=(-b-c,-c+a,a+b) $$ and $$ \mathbf{v}_4=(b-(-c),(-c)-a,-(a-b))=(b+c,-c-a,-a+b) $$ are perpendicular to \(\mathbf{u}=(a,b,c)\). Moreover, at most two of the vectors \(\mathbf{v}_j\) are the same.