Distance from a Point to a Line
Enter your known values, leave one input blank, and solves for the missing one. Try different units for next level excitement!
Learning zone
Drop a perpendicular from the point to the line and this formula gives its length, with no need to find the foot of that perpendicular first. The numerator is what you get by substituting the point into the left-hand side of Ax + By + C = 0 — zero if the point is on the line, and growing as you move away — while dividing by √(A² + B²) rescales it into a true distance. Worked example: the point (2, 3) and the line 3x + 4y − 5 = 0 give |6 + 12 − 5| / √(9 + 16) = 13/5 = 2.6.
Two traps catch people out. First, the line must be in general form with everything on one side: y = 2x + 1 has to be rewritten as 2x − y + 1 = 0, so A = 2, B = −1, C = 1. Second, the absolute value is not optional — without it the sign tells you which side of the line the point is on, which is genuinely useful (computer graphics uses exactly that signed version to decide whether a pixel is inside a polygon), but it is not a distance. The formula is the two-dimensional case of a pattern that recurs everywhere: the same expression with a third term measures a point's distance from a plane, and machine-learning support-vector machines maximise precisely this quantity to place a boundary as far as possible from the nearest data.
- = Distance to the line
- = Coefficient of x
- = Coefficient of y
- = Constant term
- = Point x-coordinate
- = Point y-coordinate
- Distance to the line — Distance Formula (3D), Distance Formula (2D)
- Coefficient of x — Quadratic Formula (Positive Root), Quadratic Formula (Negative Root)
- Coefficient of y — Quadratic Formula (Positive Root), Quadratic Formula (Negative Root)
- Constant term — Pythagorean Theorem, Area of a Circle
- Point x-coordinate — Slope Between Two Points, Point-Slope Form of a Line
- Point y-coordinate — Slope Between Two Points, Point-Slope Form of a Line