Coordinate geometry

Point-to-Line Distance

Find the perpendicular gap from a point to a line in general form, with the scaling of the normal made explicit.

Back to topic

Formula

d = |a x1 + b y1 + c| / sqrt(a^2 + b^2)

Result

Worked substitution


          

The denominator is the length of the line normal vector, so the formula scales correctly.

Read the result

The numerator tells you how far the point misses the line equation. The denominator rescales that miss into an actual perpendicular distance.

Where it helps

This is the clean route for clearance, offset, tolerance, and shortest-distance questions where the line is already in ax + by + c = 0 form.

Common slip

The formula expects general form. If your line is y = mx + c, rearrange it first to mx - y + c = 0.

Try it

Double a, b, and c together. The line is the same, so the distance should not change.