Distance from a point to a line
The shortest distance from a point to the line , measured along the perpendicular.
Calculator
The live calculator needs JavaScript. The worked example below shows the same steps it would.
See it move
- Line: 3x + 4y − 10 = 0
- Shortest distance d ≈ 5.8, along the perpendicular to the foot (1.52, 1.36)
What the symbols mean
- the shortest (perpendicular) distance
- the coefficient of x in the line's equation
- the coefficient of y
- the constant term (with the equation arranged to equal 0)
- the x-coordinate of the point
- the y-coordinate of the point
When to use it
Use it for the gap between a point and a line, the height of a triangle drawn on a grid, the distance between two parallel lines (pick a point on one), and to test whether a line is tangent to a circle: it is when the distance from the centre to the line equals the radius. Rearrange the line to first, so becomes .
Worked example
How far is the point (5, 6) from the line 3x + 4y − 10 = 0? Here a = 3, b = 4 and c = −10.
Start from the formula.
Substitute = , = , = , = , = and work it out.
The closest point on the line (the foot of the perpendicular) is .
Answer d = 5.8
Why it works
The vector (a, b) is perpendicular to the line. Putting the point into measures how far along that direction the point is from the line, scaled by the length ; dividing removes the scale, and the absolute value makes the distance positive on either side.
Common mistakes
- Using the line in the form without rearranging to .
- Dropping the absolute value and reporting a negative distance.
- Dividing by instead of its square root.