Finding the nearest point to the origin on a line.

1k Views Asked by At

enter image description here

In the above picture, I am trying to find the smallest distance from points on the line segment to the origin.

Now, I can see that it must be half the square root of 2, but this is not exactly my question.

How can I use calculus to find the smallest distance from points on a line to a point(the origin)? In my previous calculus courses we have studied optimization but it does not apply to this scenario.

4

There are 4 best solutions below

2
On BEST ANSWER

You want to minimize $$ d^2 = (x-0)^2+(y-0)^2$$

The equation of your line is $$y=1-x$$

Thus you are minimizing $$d^2 = x^2+(1-x)^2$$

Taking derivative you get $$2x-2(1-x)=0$$ which results in $x=1/2$

The point on the line is then $(1/2,1/2)$ with the minimum distance from the origin $\sqrt 2 /2$ as expected.

0
On

The first thing you'll want to do is associate every point on your line with some real number, in a 1-to-1 fashion. Say for each point $p$ on your line, you associate a number $L(p) \in \mathbb{R}$. (See how, and some extra details, later.)

Then define a function $f$ on $\mathbb{R}$, where $f(x)$ is the distance between the origin and the point on the line associated with $x$, which is $L^{-1}(x)$. This is a well defined function, and you finding its minimum will give you the smallest length between the line and the origin. You can do this using calculus as usual!

So, how do we get $L$? The line is given by $y=1-x$, so every point on the line is of the form $(x, 1-x)$. You can therefore associate this point with $x$; that is, $L((x,1-x)) = x$. Remark that $L$ is invertible by design: $L^{-1}(x) = (x,1-x)$. The function $f$ is therefore:

$$ f(x) = |(0,0)-L^{-1}(x)| = |(x,1-x)| = \sqrt{x^2 + (1-x)^2} $$

You can find the minimum $x$ of this function to get the minimum length $f(x)$, and take $L^{-1}(x)$ to find the point at which the minimum is obtained.

Note: $L$ is a 1-to-1 map from the line to $\mathbb{R}$, so it is invertible on its range. In this case the range was the whole real line, but if we were instead dealing with a line segment, $f$ would only be defined on the range of $L$.

0
On

Recall that for any line

$$ax+by+c=0$$

the vector $(b,-a)$ is perpendicolar to the line then the intersection is given by

  • $bx-ay=0 \implies abx=a^2y$

  • $ax+by+c=0 \implies abx+b^2y+bc=0 \implies y=-\frac{bc}{a^2+b^2}\quad x=-\frac{ac}{a^2+b^2}$

that is

$$d=(x^2+y^2)^\frac12=\frac{c}{\sqrt{a^2+b^2}}$$

0
On

Let $\vec{r}=<x(t),y(t)>$

Then the distance from the origin is $d=\sqrt{\vec{r}\cdot\vec{r}}$

We take the derivative with respect to $t$ and set to zero.

$0=(\vec{r}\cdot \vec{\dot r})/\sqrt{\vec{r} \cdot \vec{r}}$

So for any differentiable curve, the distance to the origin extrema occur at points where the velocity vector is perpendicular to the position vector. But the position vector points from the origin to the position on the curve. So the tangent line to the curve, i.e. the velocity vector, is perpendicular to the line pointing from the origin tot he curve.

$$ <x(t),y(t)>\cdot <\dot{x}, \dot{y}>=x\dot{x}+y\dot y=0$$.

$$\frac{dy/dt}{dx/dt}=\frac{dy}{dx}$$

$$\frac{dy}{dx}=\frac{-x}{y}$$

For a line, this means $m=-x/y$.