# Trying to derive the distance of a point from a line using maxima/minima.

• November 13th 2013, 11:17 PM
AaPa
Trying to derive the distance of a point from a line using maxima/minima.
The distance of a point from a line Ax+By+C=0 is $\lvert\frac{Ax+By+C}{\sqrt{A^2+B^2}}\rvert$

I took a point on the line (x,y) and any other point (x1,y1). I wrote the distance between them and replaced y with an expression of x using the equation of the line.
Then i differentiated the expression to find the minimum distance. I got this

Bx - Bx1 + A ( y1 + (Ax + c)/B ) divided by sqrt ( B2(x1-x)2 + (By1 + Ax + c)2)

What now?
• November 14th 2013, 01:45 PM
chiro
Re: Trying to derive the distance of a point from a line using maxima/minima.
Hey AaPa.

Hint: If the geometry is flat (i.e. R^n) then the distance between a point and a line that is the shortest will have the line formed between the two points be orthogonal to the plane.

This satisfies the relationship l = at + (b-a)(1-t) for the line and <b-a,x-a> = 0 where x is the point you are trying to find the distance for with respect to the line.

You are solving for the vector a in which the distance from x to the line will be the length of x-a or |x-a|.

You can calculate b-a by transforming Ax + By + C = 0 to the form l(t) = at + (b-a)t and then use that to solve for <b-a,x-a> = 0. Also remember that you don't need an actual value for b or a, you only need the direction of the line which corresponds to b-a. You should also make it unit length.

I'll let you fill in the blanks but if you need help just show us where you get stuck.
• November 14th 2013, 02:41 PM
HallsofIvy
Re: Trying to derive the distance of a point from a line using maxima/minima.
This is in two dimensions so we don't really need to worry about "planes". The shortest distance from $(x_0, y_0)$ to the line Ax+ By+ C= 0 is, as chiro said, is along the line perpendicular to the original line. We can write the line as y= (-A/B)x- (C/B) which has slope -A/B. Any line perpendicular to it has slope B/A. In particular, a line perpendicular to the original line, through $(x_0, y_0)$ can be written as $y= (B/A)(x- x_0)+ y_0$. Determine where that line intersects the line Ax+ By+ C= 0, then find the distance between that intersection point and $(x_0, y_0)$.
• November 14th 2013, 08:28 PM
AaPa
Re: Trying to derive the distance of a point from a line using maxima/minima.
i just wanted to know if i could find the perpendicular distance between them by finding the minimum distance between them using differentiation.