Shortest distance between line and point

In summary, the shortest distance between a point and a line is perpendicular if and only if the line is tangent to the point.
  • #1
karush
Gold Member
MHB
3,269
5
Show that the shortest distance from the point $\left(x_1,y_1\right)$ to a straight line
$$Ax_1+By_1+C=0$$ is
$$\frac{|Ax_1+By_1+C|}{\sqrt{A^2+B^2}}$$

ok, well a line from a point to a line is shortest if it is perpendicular to that line

obviously we are trying to find out a min value to this but taking a derivative of this without numbers is rather daunting and the question is asking for a proof

anyway not much of a start, but caught in the bushes already...

I did read the commentary on
"Finding the distance between a point and a line"

but this problem is under applications of differentiation which seem hard to set up

the book didn't give an answer to this...:cool:
 
Last edited:
Physics news on Phys.org
  • #2
Re: shortest distance between line and point

Given that this is a calculus exercise, I would say you should not assume the shortest distance is perpendicular, but rather you should define the distance function $D(x)$ and then optimize it.

I would let \(\displaystyle (x,y)=\left(x,-\frac{Ax+C}{B} \right)\) be an arbitrary point on the line and then let$f$ represent the square of the distance function, since minimizing it will also minimize the distance function itself.

\(\displaystyle f(x)=D^2(x)=\left(x-x_1 \right)^2+\left(\frac{Ax+C}{B}+y_1 \right)^2\)

Now, differentiate with respect to $x$, and equate to zero to find the critical value.
 
  • #3
Re: shortest distance between line and point

I added https://driven2services.com/staging/mh/index.php?posts/36541/ to the commentary thread, but it relies on the properties of dot product rather than calculus.
 
  • #4
Another way to prove the distance formula by calculus is to use Lagrange multipliers. We want to minimise the square of the distance, $d^2 = (x-x_1)^2 + (y-y_1)^2$ subject to the constraint $Ax+By+C = 0.$ So we take the partial derivatives of $(x-x_1)^2 + (y-y_1)^2 - \lambda(Ax+By+C)$ with respect to $x$ and $y$, and put them equal to $0$: $$2(x-x_1) - \lambda A = 0,\qquad 2(y-y_1) - \lambda B = 0.$$ Thus $x = x_1 + \frac12\lambda A,\ y = y_1 + \frac12\lambda B$. Substitute those into the constraint equation to get $A\bigl(x_1 + \frac12\lambda A\bigr) + B\bigl(y_1 + \frac12\lambda B\bigr) + C = 0$, from which $\lambda = - \dfrac{2(Ax_1+By_1+C)}{A^2+B^2}.$ Then $$d^2 = (x-x_1)^2 + (y-y_1)^2 = \bigl(\tfrac12\lambda A\bigr)^2 + \bigl(\tfrac12\lambda B\bigr)^2 = \bigl(\tfrac12\lambda\bigr)^2(A^2+B^2) = \frac{(Ax_1+By_1+C)^2}{A^2 + B^2}.$$ Now take the square root to get $d = \dfrac{|Ax_1+By_1+C|}{\sqrt{A^2+B^2}}.$
 
  • #5
Re: shortest distance between line and point

MarkFL said:
\(\displaystyle f(x)=D^2(x)=\left(x-x_1 \right)^2+\left(\frac{Ax+C}{B}+y_1 \right)^2\)

Now, differentiate with respect to $x$, and equate to zero to find the critical value.

I got lost trying $d/dx$ this
 
  • #6
Re: shortest distance between line and point

karush said:
I got lost trying $d/dx$ this

Okay, let's have a look see...

Using the power and chain rules, we obtain:

\(\displaystyle \frac{df}{dx}=2\left(x-x_1 \right)(1)+2\left(\frac{Ax+C}{B}+y_1 \right)\left(\frac{A}{B} \right)=0\)

Multiplying through by \(\displaystyle \frac{B^2}{2}\), we may write:

\(\displaystyle B^2\left(x-x_1 \right)+A\left(Ax+C+By_1 \right)=0\)

Solving for $x$, there results:

\(\displaystyle x=\frac{B^2x_1-ABy_1-AC}{A^2+B^2}\)

Because $f$ is the sum of two squares, we know this critical value must be at the global minimum, but we could also use the argument that:

\(\displaystyle \frac{d^2f}{dx^2}=2+2\frac{A^2}{B^2}>0\,\forall (A,B)\in\mathbb{R}\)
 
  • #7
A much simpler approach involves trigonometry.

Let $p$ be the perpendicular distance between the point and the line. we may then state:

\(\displaystyle d(\theta)=p\csc(\theta)\)

Now, minimize this function. :D
 

FAQ: Shortest distance between line and point

What is the shortest distance between a line and a point?

The shortest distance between a line and a point is the perpendicular distance from the point to the line.

How do you calculate the shortest distance between a line and a point?

To calculate the shortest distance between a line and a point, you can use the formula: d = |ax + by + c| / √(a^2 + b^2), where (x,y) is the coordinates of the point and a, b, and c are the coefficients of the line's equation in standard form.

Can the shortest distance between a line and a point be negative?

No, the shortest distance between a line and a point cannot be negative as it represents a distance, which is always a positive value.

What is the significance of finding the shortest distance between a line and a point?

Finding the shortest distance between a line and a point is important in many fields of science and engineering, such as physics, geometry, and computer graphics. It allows us to determine the closest point on a line to a given point, which can be useful in solving various real-world problems.

Is the shortest distance between a line and a point always unique?

Yes, the shortest distance between a line and a point is always unique. This is because a line has infinite points and the distance between any two points on a line will always be the same. Therefore, the shortest distance from a given point will always be the same as it is unique.

Similar threads

Replies
4
Views
2K
Replies
2
Views
2K
Replies
11
Views
827
Replies
12
Views
2K
Replies
4
Views
9K
Replies
11
Views
3K
Back
Top