Loading…

Point to Line Distance Calculator

Math Geometry • Coordinate Geometry

View all topics

Find the shortest (perpendicular) distance from a point to a line. Works for vertical/horizontal lines too. The graph is interactive: drag to pan, wheel/trackpad to zoom, pinch on touch.

Inputs accept 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Inputs
Point
Line

Tip: In general form, scaling \((a,b,c)\) by a nonzero constant does not change the distance.

Graph options

Graph uses square units: 1 unit in \(x\) equals 1 unit in \(y\).

Ready
Choose a mode and click Calculate.
Point-to-line distance (pan/zoom enabled)

Drag to pan • wheel/trackpad to zoom • pinch on touch • “Reset view” fits the geometry.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is the formula for the distance from a point to a line?

For a line ax + by + c = 0 and a point (x0, y0), the perpendicular distance is d = |a x0 + b y0 + c| / sqrt(a^2 + b^2). The line is valid only if a and b are not both zero.

Why does multiplying (a, b, c) by a constant not change the distance?

Scaling a, b, and c by the same nonzero constant represents the same geometric line. The numerator and denominator scale by the same factor in the distance formula, so the ratio stays the same.

How do you convert slope-intercept form to general form for the distance formula?

Starting from y = m x + k, move all terms to one side to get m x - y + k = 0. Then use a = m, b = -1, and c = k in the distance formula.

Does this work for vertical or horizontal lines?

Yes. Vertical and horizontal lines are handled by the general-form distance formula, so the calculator still returns the perpendicular distance without needing a slope.