Finding the distance from a point to a line

lukatmyshu

Senior member
Aug 22, 2001
483
1
0
Given the end-points of a line, and the coordinates of another point -- anyone have an easy solution to the tangential distance between the point and the line? I realize that the dot-product of the vector between the tangential piece and the line is zero but can't proceed from there.
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
I would first try to find the the coordinates on the line that's closest to the point, so you have 2 unknowns, the x and y coordinate.

Equation 1: Dot product of the line and the tangental line is zero
Equation 2: The coordinate of the unknown must lie on the line..

You should be able to solve it from there.
 

lukatmyshu

Senior member
Aug 22, 2001
483
1
0
Originally posted by: TuxDave
I would first try to find the the coordinates on the line that's closest to the point, so you have 2 unknowns, the x and y coordinate. Equation 1: Dot product of the line and the tangental line is zero Equation 2: The coordinate of the unknown must lie on the line.. You should be able to solve it from there.

It's that second part that confuses me ... how do I impose the restriction that a point be on a particular line? Specifically ... what is the general form of points that can be found on a line ... oh I just realized it ... since the equation of the line is ax + by = c, given my x and y I can create a general form for points on the line ... in conjunction with equation 1, I should get my second point (the one on the line and tangential to the point not on the line) ... thanks.
 

lukatmyshu

Senior member
Aug 22, 2001
483
1
0
Originally posted by: FrustratedUser
What is tangential distance?

Tangential meaning that they are ninety-degrees to each other. The tangential distance between a point and a line is just the shortest distance possible) ... the distance if we were to draw a line through the point that is orthogonal to the line.