Is there a better way to find the closest point on a line?

Solution 1:

Since your curve is a straight line with a slope of $4$, a perpendicular to this line will have a slope of $-1/4$.

Using point-slope form, a line with a slope of $-1/4$ going through $(1,3)$ will have the following equation:

$$y-3 = (-1/4)(x-1)$$

Solving for the intersection of this line and the original line will give you your answer.

EDIT: The comments noted that I jumped in using the perpendicular as the shortest distance without explaining why it was so. Here's a brief argument which can be worked out with more rigor if desired. Take the $x-y$ axes, which are perpendicular. Take the point $(0,5)$ which is $5$ units away from the origin, which lies on the $x$-axis and is also on the perpendicular from that point to the $x$ axis. If we go in either direction along the $x$ axis, the distance from $(0,5)$ to this point on the $x$ axis will increase, because now it's going along the hypotenuse of a right triangle defined by the origin, the point $(0,5)$, and the point of intersection, and this has to be longer than $5$ units. So, the perpendicular is the minimum distance.

Solution 2:

You can make the problem simpler since minimizing the distance is the same as minimizing the square of the distance.

Then $$D^2=(x-1)^2+(4x-3-3)^2=17 x^2-50 x+37$$ $$\frac{d(D^2)}{dx}=34 x-50$$ $$\frac{d^2(D^2)}{dx^2}=34 > 0$$

So the first derivative cancels if $x=\frac{25}{17}$ to which cooresponds $y=\frac{49}{17}$, $D^2=\frac{4}{17}$. The second derivative test confirms that this is a minimum.

Solution 3:

My only issue is that my solution doesn't account for if there was a maximum instead of a minimum on the distance equation.

Well, you can solve this problem by invoking the "first derivative test".

You got $f'(x)=0$ if $x=\frac{50}{34}$. Analogously:

  • $f'(x)<0$ if $x<\frac{50}{34}$
  • $f'(x)>0$ if $x>\frac{50}{34}$

Thus, $f$ is decreasing on $(-\infty,\frac{50}{34})$ and increasing on $(\frac{50}{34},\infty)$. So, $f$ has a minimum at $\frac{50}{34}$.

Solution 4:

Use the fact that the distance from a point $(x_0, y_0)$ to a line $ax + by + c = 0$ is given by $$\frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}$$ Plugging in the numbers in question, we get $$\frac{|-4(1) + 1(3) + 3|}{\sqrt{1^2 + 4^2}} = \frac{2\sqrt{17}}{17}.$$

If you want a proof of the formula, check here.

Solution 5:

A simple, Linear Algebra approach. First,represent the intercept, the point and the direction of the line as vectors.

$p=<0,-3>,q=<1,3>,v=<1,4>$

Create the vector projection of the line between $p$ and $q$ onto $\vec{v}$

$\vec{u}=\vec{q}-\vec{p}, w=\frac{\vec{u}.\vec{v}}{\vec{v}.{\vec{v}}}\vec{v}$

Giving $\vec{u}=<1,6>,\vec{w}=<\frac{25}{17},\frac{100}{17}>$ then

the closest point is given by $r=\vec{p}+\vec{w} = <1,-3>+<\frac{25}{17},\frac{49}{17}>$