Point-Line Distance--2-Dimensional
The equation of a line ax+by+c=0 in slope-intercept form is given by
y=-a/bx-c/b, |
(1)
|
so the line has slope -a/b. Now consider the distance from a point (x_0,y_0) to the line. Points on the line have the vector coordinates
Therefore, the vector
[画像: [-b; a] ] |
(3)
|
is parallel to the line, and the vector
[画像: v=[a; b] ] |
(4)
|
is perpendicular to it. Now, a vector from the point to the line is given by
[画像: r=[x-x_0; y-y_0]. ] |
(5)
|
Projecting r onto v,
If the line is specified by two points x_1=(x_1,y_1) and x_2=(x_2,y_2), then a vector perpendicular to the line is given by
[画像: v=[y_2-y_1; -(x_2-x_1)]. ] |
(12)
|
Let r be a vector from the point x_0=(x_0,y_0) to the first point on the line
[画像: r=[x_1-x_0; y_1-y_0], ] |
(13)
|
then the distance from (x_0,y_0) to the line is again given by projecting r onto v, giving
As it must, this formula corresponds to the distance in the three-dimensional case
with all vectors having zero z-components, and can be written in the slightly more concise form
where det(A) denotes a determinant.
The distance between a point with exact trilinear coordinates (alpha^',beta^',gamma^') and a line lalpha+mbeta+ngamma=0 is
(Kimberling 1998, p. 31).
See also
Collinear, Point-Line Distance--3-DimensionalExplore with Wolfram|Alpha
References
Kimberling, C. "Triangle Centers and Central Triangles." Congr. Numer. 129, 1-295, 1998.Cite this as:
Weisstein, Eric W. "Point-Line Distance--2-Dimensional." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html