The shortest distance (not duplicated)

curvesmultivariable-calculusvectors

This is not the same question as this

Consider the ellipse defined by $$x^2+4y^2=4$$
and the line $$x+y=4$$

find the shortest distance from a point on the ellipse to the line.

In other words, we want to find a function $D(x,y)$, you plug into it a point on the ellipse and it will tell you what is the closest point to this point on the line.

This last line wasn't in the original question, so you may try to parametrize the ellipse and the line and try to find some connection, but this method didn't work for me ($E$ is the ellipse and $L$ is the line):

$$E(t)=\langle2\cos t,\sin t\rangle, \text{ }L(t)=\langle t, 4-t \rangle$$
$$\implies D(t)=\langle t-2\cos t, 4-t-\sin t\rangle$$

but this curve doesn't work, it just tells you what is the path between two points on the ellipse and the line.

Best Answer

You know that the shortest path between any point on the ellipse and the line must be orthogonal to the line. Otherwise, because of Pythagoras, we would have a longer path.

So we have the line $y = 4-x$ with slope $-1$ so that any orthogonal lines has slope $m=1$.

Now you just need to determine the intersection between the line through your point $(x_0,y_0)$ with slope $m$ and the original line $y=4-x$:

The equation of the shortest path between $(x_0,y_0)$ and the given line is:

$$ y = s(x) = m\cdot (x-x_0) + y_0 = x-x_0+y_0 $$

Let's calculate the intersection with the given line $y = 4-x$:

\begin{align}\cases{y = x-x_0+y_0 \\ y = -x + 4 } &\implies 2y = 4-x_0+y_0 \\ &\implies y = 2 +\frac{y_0-x_0}{2}\end{align}

Inserting that into the equation $x = 4-y$ yields $$ x = 4-\left(2+\frac{y_0-x_0}{2} \right)=2 + \frac{x_0-y_0}{2} $$

The final step is to calculate the distance from $(x_0,y_0)$ and the intersection point $(x,y)$:

\begin{align} D(x_0,y_0) &= \sqrt{(x-x_0)^2+(y-y_0)^2} \\ &= \sqrt{\left(2 + \frac{x_0-y_0}{2} -x_0\right)^2 + \left(2 +\frac{y_0-x_0}{2}-y_0\right)^2} \\ &=\sqrt{\left(2 + \frac{-x_0-y_0}{2}\right)^2 + \left(2 +\frac{-y_0-x_0}{2}\right)^2} \\ &=\sqrt{2\left(2 - \frac{x_0+y_0}{2}\right)^2} \\ &= \sqrt{2}\left(2 - \frac{x_0+y_0}{2}\right) \end{align}

The last line is the formula for the distance of any point $(x_0,y_0)$ on an arbitrary ellipse (this point doesn't even need to be on an ellipse) to the given line. If the line representation changes, you just have to adjust those values in the above formula.

Related Question