# [SOLVED] Distance between a point and a line

• May 24th 2006, 11:40 AM
Silly.girl
[SOLVED] Distance between a point and a line
Alright well i've been having a lot of trouble trying to figure out how to find the distance between a line and a point not on the line.
So if anyone could help me i'd really like that.
Here are some sample problems:
Sample 1:
(6,1) and -2x+4=4

Sample 2:
(-7,-2) and y=7x-3

if you could take them step by step for me i'd really like that.

thanks.
• May 24th 2006, 12:23 PM
topsquark
Quote:

Originally Posted by Silly.girl
Alright well i've been having a lot of trouble trying to figure out how to find the distance between a line and a point not on the line.
So if anyone could help me i'd really like that.
Here are some sample problems:
Sample 1:
(6,1) and -2x+4=4

Sample 2:
(-7,-2) and y=7x-3

if you could take them step by step for me i'd really like that.

thanks.

There is a problem with sample 1: -2x + 4 = 4 isn't a line!

Generally what you want is the "perpendicular distance" between a point and a line. There is a general formula out there (I don't have it handy), but this is the basic logic of how to find it if you don't have the formula:

1. Solve the equation of the line (line 1) in slope-intercept form.
2. You want to find the equation of a line (line 2) passing through your point that is perpendicular to the original line (line 1). Thus the slope of line 2 will be -1/m(1).
3. Now you need to find the point of intersection of the two lines.
4. Now find the distance between the point of intersection and your point.

It's long and it's messy, but if you do it step by step it's really not that bad.

-Dan
• May 24th 2006, 12:31 PM
CaptainBlack
Quote:

Originally Posted by Silly.girl
Alright well i've been having a lot of trouble trying to figure out how to find the distance between a line and a point not on the line.
So if anyone could help me i'd really like that.
Here are some sample problems:
Sample 1:
(6,1) and -2x+4=4

Sample 2:
(-7,-2) and y=7x-3

if you could take them step by step for me i'd really like that.

thanks.

Let $(x,y)$ ba a point on the line. Then the distance $d$from
the point $(-7,-2)$ to the point $(x,y)$ satisfies:

$
d^2=(x+7)^2+(y+2)^2
$

but on the line $y=7x-3$, so:

$
d^2=(x+7)^2+(7x-1)^2
$

Now the point on the line closest to $(-7,-2)$ will minimise $d^2$, so we want to find the $x$ such that:

$
\frac{d}{dx}d^2=0
$
,

which is equivalent to:

$
\frac{d}{dx}[(x+7)^2+(7x-1)^2]=2(x+7)+14(7x-1)=0
$
,

or $x=0$. so the closest point to the given point is $(0,-3)$.

Hence the required distance is: $\sqrt{50}$

RonL
• May 24th 2006, 01:18 PM
ThePerfectHacker
Given a line with equation,
$Ax+By+C=0$
Then, the point, $(x_0,y_0)$ the distance between them is,
$\frac{|Ax_0+By_0+C|}{\sqrt{A^2+B^2}}$
• Jun 1st 2006, 05:25 AM
malaygoel
Quote:

Originally Posted by topsquark
There is a problem with sample 1: -2x + 4 = 4 isn't a line!

-Dan

-2X+4=4 REPRESENTS ALINE. IF YOU SOLVE IT YOU WILL GET
X=0
WHICH REPRESENTS Y-AXIS
• Jun 1st 2006, 05:30 AM
malaygoel
Quote:

Originally Posted by Silly.girl
Alright well i've been having a lot of trouble trying to figure out how to find the distance between a line and a point not on the line.
So if anyone could help me i'd really like that.
Here are some sample problems:
thanks.

Let your line be Ax + By +C=0 and the point be a,b
since shortect distance in euclidean geometry is perpendicular distance, we will find the of perpendicular line which will be of the form of Bx -Ay +k= 0.
Rest you try yourself.