Concept

Distance from a point to a line

Summary
In Euclidean geometry, the distance from a point to a line is the shortest distance from a given point to any point on an infinite straight line. It is the perpendicular distance of the point to the line, the length of the line segment which joins the point to nearest point on the line. The algebraic expression for calculating it can be derived and expressed in several ways. Knowing the distance from a point to a line can be useful in various situations—for example, finding the shortest distance to reach a road, quantifying the scatter on a graph, etc. In Deming regression, a type of linear curve fitting, if the dependent and independent variables have equal variance this results in orthogonal regression in which the degree of imperfection of the fit is measured for each data point as the perpendicular distance of the point from the regression line. In the case of a line in the plane given by the equation ax + by + c = 0, where a, b and c are real constants with a and b not both zero, the distance from the line to a point (x0, y0) is The point on this line which is closest to (x0, y0) has coordinates: Horizontal and vertical lines In the general equation of a line, ax + by + c = 0, a and b cannot both be zero unless c is also zero, in which case the equation does not define a line. If a = 0 and b ≠ 0, the line is horizontal and has equation y = −c/b. The distance from (x0, y0) to this line is measured along a vertical line segment of length y0 − (−c/b) = by0 + c/b in accordance with the formula. Similarly, for vertical lines (b = 0) the distance between the same point and the line is ax0 + c/a , as measured along a horizontal line segment. If the line passes through two points P1 = (x1, y1) and P2 = (x2, y2) then the distance of (x0, y0) from the line is: The denominator of this expression is the distance between P1 and P2. The numerator is twice the area of the triangle with its vertices at the three points, (x0, y0), P1 and P2. See: .
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.