Distance of a Point From a Line - Formula & Examples

Distance of a Point From a Line - Formula & Examples

TL;DR

The distance of a point from a line is the shortest length between them, measured along the perpendicular dropped from the point to the line. For a point (x0,y0) and a line Ax+By+C=0, that distance is d=∣Ax0+By0+C∣A2+B2; this article derives the formula and works six examples.

What Is the Distance of a Point From A Line?

The distance of a point from a line is the length of the perpendicular segment drawn from the point to the line. It is the shortest possible distance between the fixed point and any point on the line.

Why the perpendicular, and not some other segment? Drop the perpendicular from point P to the line, meeting it at foot M. Now pick any other point Q on the line and join P to Q. The triangle PMQ has a right angle at M, so PQ is its hypotenuse - and the hypotenuse is always the longest side. So PM (the perpendicular) is shorter than PQ for every other choice of Q. The perpendicular wins, always.

This lives in coordinate geometry: we describe the point with coordinates (x0,y0) on the coordinate plane and the line with an equation of a straight line, then compute the gap without ever drawing it.

Let's take an example: A pilot flying a straight course wants to know: how close will I actually pass to that mountain peak?

The peak is a single point. The flight path is a straight line. The answer the pilot needs is not any old distance to the line - it is the shortest one, the near-miss distance. That single number is what "distance of a point from a line" means, and coordinate geometry gives it a clean formula.

What Is The Formula?

For a point P(x0,y0) and a line written in standard form Ax+By+C=0, the perpendicular distance is:

d=∣Ax0+By0+C∣A2+B2

The pieces mean:

The formula needs the line in standard form first. If the line is given as y=mx+c, rewrite it as mx−y+c=0, so A=m, B=−1, C=c.

Where does the formula come from?

A short derivation, one step per line. Take line L:Ax+By+C=0 and point P(x0,y0).

The line crosses the axes at intercepts (−C/A,0) and (0,−C/B).

Form triangle PAB using P and those two intercepts.

Compute its area two ways. First, using the coordinate area formula, the area works out to 12⋅∣C∣⋅∣Ax0+By0+C∣∣AB∣.

Second, area =12⋅(base AB)⋅(height d), where d is the perpendicular distance we want and the base AB=∣C∣√A2+B2.

Setting the two area expressions equal and cancelling gives:

d=∣Ax0+By0+C∣A2+B2.

The numerator is just the line's expression evaluated at the point; the denominator rescales it into a true length.

Examples Of Distance Of A Point From A Line

Example 1

Find the distance from the point (0,0) to the line 3x+4y−10=0.

Here A=3, B=4, C=−10, and (x0,y0)=(0,0).

d=∣3⋅0+4⋅0−10∣32+42 = ∣−10∣5 = 2.

Final answer: the distance is 2 units.

Example 2

Find the distance from (2,3) to the line y=2x+1.
Rewrite in standard form: 2x−y+1=0, so A=2, B=−1, C=1.

d=∣2⋅2+(−1)⋅3+1∣22+(−1)2 =2/√5 ≈ 0.894.

Final answer: about 0.894 units.

Example 3

Find the distance from (1,1) to the line x+y−4=0.

A=1, B=1, C=−4.

d=∣1⋅1+1⋅1−4∣12+12=2/√2 ≈ 1.414.

Final answer: 2√2, about 1.414 units.

Example 4

Find the distance from the origin to the line 5x−12y+26=0.

A=5, B=−12, C=26.

d=∣5⋅0−12⋅0+26∣52+(−12)2 = 2.

Final answer: 2 units.

Example 5

A point lies on the line 2x+3y−6=0. Find its distance from that line.

d=∣2⋅3+3⋅0−6∣22+32=0.

Final answer: 0.

Example 6

Find the distance between the two parallel lines 3x+4y−7=0 and 3x+4y+3=0.

Pick any point on the first line, measure it against the second line: d=∣3⋅1+4⋅1+3∣32+42=2.

Final answer: the parallel lines are 2 units apart.

Why This Formula Matters

The perpendicular-distance formula answers a question that comes up far more often than its textbook home suggests.

The real problem it solves is "how close does a straight path come to a fixed spot?".

The Mistakes Students Make Most Often

Mistake 1: Using slope-intercept form instead of standard form

Where it slips in: the line is handed over as y=mx+c and students plug straight in.

The correct way: rewrite as Ax+By+C=0 first.

Mistake 2: Dropping the absolute value

Where it slips in: when Ax0+By0+C comes out negative.

The correct way: the bars are part of the formula - a distance is always positive.

Mistake 3: Confusing it with the distance between two points

Where it slips in: using two-point distance formula instead of the perpendicular formula.

Conclusion