TOPICS
Search

Point-Line Distance--2-Dimensional


PointLineDistance2D

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

is parallel to the line, and the vector

is perpendicular to it. Now, a vector from the point to the line is given by

Projecting r onto v,

PointLineDistance2DVec

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

Let r be a vector from the point x_0=(x_0,y_0) to the first point on the line

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-Dimensional

Explore 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

Subject classifications

AltStyle によって変換されたページ (->オリジナル) /