Vector proof of shortest distance from a point to a line: flaw in the reasoning.

analytic geometrygeometrymultivariable-calculusoptimizationvectors

Let $E$ an euclidean plane, $P$ a point in $E$, and $d$ a straight line in $E$ with a fixed point $A$ and a direction vector $\vec{V}$ , so that any other point $X \in d$ can be described through a real parameter $t$ by $$\vec{AX}=t\vec{V}$$.

Consequently, we can write $$\vec{PX}=\vec{PA}+t\vec{V} \,\,\,\,\,\,\,\,\,\,\,\,\ [1]$$

In this mathexchange question, I have a problem with a proof to show the shortest distance from $P$ to $d$. In fact, I am able to calculate it by minimizing the quantity $$||\vec{PX}||^2$$ seen as a function of $t$. That expression is purely scalar so it's easy to avoid mistake when minimizing it through differentiation. But just out of curiosity I tried to get to the same result by minimizing $\vec{PX}$ instead of its square, and I have a problem: I can show the shortest distance is perpendicular, but I get the magnitude wrong. Here is the reasoning:

First I write $\vec{PX}=|\vec{PX}|.e_{\vec{PX}}$, where $e$ is the unit vector along the direction of $\vec{PX}$.

Minimizing equation $[1]$ with respect to $t$ means two things:

1/ First I must differentiate both sides of $[1]$:
$$(\partial_t|\vec{PX}|).e_{\vec{PX}}+|\vec{PX}|.(\partial_te_{\vec{PX}})=0+\vec{V}\,\,\,\,\,[2]$$

2/ Now I impose the minimization condition on the distance: this means that the object $\partial_t|\vec{PX}|=0$, so the only part that survives in the expression $[2]$ is

$$|\vec{PX}|.(\partial_te_{\vec{PX}})=\vec{V}\,\,\,\,\,[3]$$

Now there is a reasoning of vector calculus that tells us that the differential of a unit vector is perpendicular to it. The LHS of $[3]$ tells us that $\partial_te_{\vec{PX}}$ is perpendiculat to $\vec{PX}$ but the RHS of $[3]$ tells us that this perpendicular object is also parallel to $\vec{V}$. Hence the shortest distance $|\vec{PX}|$ is perpendicular to the straight line $d$.

But then I get stuck and I don't see how to get the magnitude of that distance. At first I would want to write $$|\vec{PX}|=\frac{|\vec{V}|}{|\partial_te_{\vec{PX}}|} \,\,\,\,\,\, [4]$$

I do not see how to calculate the actual magnitude of $|\vec{PX}|$ from there. In fact, I suspect there is a mistake somewhere, because the direction vector $\vec{V}$ can be arbitrarily small or large, while $\vec{PX}$ is fixed by the geometry. I am probably missing something very silly. I have explained the problem the most clearly I can, any insight would be appreciated. Thanks.

Best Answer

Below are two(?) explanations to why $\partial_te_{\vec{PX}}$ depends on $\vec V$. The analytical one probably isn't very helpful to OP, but I didn't feel like erasing it after I wrote it.


Alternative analytical way

Assuming that $P$ doesn't belong to line $d$, you are guaranteed that $\|\vec{PX}\| > 0$, and can define $$ e_{\vec{PX}} := \frac{\vec{PX}}{\|\vec{PX}\|} $$ Now to see the dependency of $e_{\vec{PX}}$ on $\vec V$, just plug in your equation $[1]$: $$ \vec{PX} = \vec{PA} + t\vec V $$ If you write down the expression of $e_{\vec{PX}}$ as a function of $t$ before differentiating (which is really annoying due to the norm in the denominator), you'll clearly end up with some $\vec V$ in $\partial_te_{\vec{PX}}$. Skipping through the computation steps, I personally end up with this expression: $$ \partial_te_{\vec{PX}} = \frac{\vec V}{\|\vec{PX}\|} - e_{\vec{PX}}\left\langle e_{\vec{PX}},\ \frac{\vec V}{\|\vec{PX}\|}\right\rangle $$ In the particular case that $X(t)$ is the closest point on $d$ to $P$, this simplifies to $$ \partial_te_{\vec{PX}} = \frac{\vec V}{\|\vec{PX}\|} $$ which is coherent with everything you did, and is a simple re-statement of your equation $[3]$.


More geometric way

With your equation $[1]$, it's straightforward to see that the magnitude of $\vec V$ directly influences how "fast" point $X(t)$ moves along line $d$ (let's just say that $t$ represents time). This influence of $\vec V$ on speed is why the derivative of $e_{\vec{PX}}$ with respect to $t$ also depends on $\vec V$.

To illustrate this, I'll introduce some additional notations. Because we're in $2D$, for any unit vector $e$, you can find a real number $\theta\in\mathbb R$ such that $$ e = \mathbf u(\theta) := \begin{pmatrix} \cos\theta\\ \sin\theta \end{pmatrix} $$ This of course applies to $e_{\vec{PX}}$, and to highlight the dependency on $t$ I'll keep it in the notation: $$ e_{\vec{PX}} = \mathbf u(\theta(t)) $$ Note that if $e_{\vec{PX}}$ varies continuously, you can force $\theta(t)$ to also be continuous. Assuming that everyone can be differentiated wrt $t$, you end up with: $$ \partial_t e_{\vec{PX}} = \Big(\partial_t\theta(t)\Big)\times\mathbf u\left(\theta(t) + \frac\pi2\right) $$ This isn't important, but the term $\mathbf u\left(\theta(t)+\frac\pi2\right)$ is still a unit vector, and is specifically the rotation of $\mathbf u(\theta(t))$ by an angle of $\frac\pi2$ radians.

Next, $\partial_t\theta(t)$ is representative of how fast the vector $e_{\vec{PX}}$ rotates (around the fixed point $P$,) as $X(t)$ moves on line $d$, which depends both on the distance of $P$ from $d$, and the speed of $X(t)$ on $d$, which is precisely where $\vec V$ comes in.


If you still have trouble with this, picture the following situation: there's a straight road in front of you, on which every car drives at a constant speed. You decide to pick one of these cars at random, and to follow it with your eyes, while staying immobile. The speed at which you have to turn your overall gaze (with a combination of head and eye movements) depends on the speed of the car. That's especially obvious when the car is closest to you.