Point to Line Distance Calculator

Find the distance from a point to a line.

How it is calculated

The line must be written in general form A·x + B·y + C = 0. The perpendicular distance from the point (x₀, y₀) is d = |A·x₀ + B·y₀ + C| / √(A² + B²). The numerator measures how far the point is from satisfying the line equation, and the denominator is the length of the normal vector (A, B), which scales that into real length units. The result is always zero or positive because of the absolute value, and it is zero exactly when the point lies on the line. If A and B are both 0 there is no line, so no result is given. Units are whatever your coordinates use.

Worked example

Take the line 3x + 4y − 10 = 0 (A = 3, B = 4, C = −10) and the point (5, 6). Substitute: 3·5 + 4·6 − 10 = 15 + 24 − 10 = 29. The denominator is √(3² + 4²) = √25 = 5. So d = |29| / 5 = 5.80 units.

Try this example →

Common mistakes

  • Leaving the line as y = mx + k and typing m and k into A and B; first rearrange to the form Ax + By + C = 0 (for y = mx + k use A = −m, B = 1, C = −k).
  • Getting the sign of C wrong when moving the constant to the left-hand side.
  • Swapping the point's x and y coordinates.
  • Dropping the absolute value by hand and reporting a negative distance; distance is never negative.
  • Using this for a line segment: the tool measures to the infinite line, so the nearest point may lie beyond the segment's ends.

About this calculator

This calculator finds the shortest distance from a point to a line using the standard formula d = |Ax₀ + By₀ + C| / √(A² + B²), where the line is written as Ax + By + C = 0 and (x₀, y₀) is the point. That shortest path is always the perpendicular segment from the point to the line.

Students use it to check analytic geometry homework, and it shows up in real applications like computer graphics (collision detection), robotics (path planning), and CAD software (measuring clearances). Enter the line's coefficients and the point's coordinates to get the distance instantly.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators