Distance Between a Point and a Line

Distance Between a Point and a Line

The distance from a point to a line is the length of the shortest segment connecting them, which is always perpendicular to the line. This distance is given by a compact formula involving the line's equation and the point's coordinates.

Quick Reference

Formula Description
Distance from to the line

The Distance Formula

Point-to-Line Distance Theorem

The perpendicular distance from the point to the line with equation is:

The absolute value in the numerator ensures the distance is always non-negative, regardless of which side of the line the point lies on. The denominator is the length of the normal vector to the line.

Diagram showing a point P(x₀, y₀) above a line L with equation ax + by + c = 0. A perpendicular segment of length d connects P to the foot Q on the line.
The perpendicular distance d from point P to line L
Proof (click to expand)

Drop a perpendicular from to and call the foot . Since the slope of is , the perpendicular through has slope , giving:

Since lies on :

Let denote this common ratio. Then and . The distance is:

To find , use the fact that satisfies . Substituting and :

so . Therefore:

Note: The proof above assumes and , but the formula remains valid when either or .

How to Apply the Formula

Step-by-Step Procedure

  1. Rewrite the line equation in the form (move all terms to one side).
  2. Identify , , , and the point .
  3. Substitute into .
  4. Simplify. Rationalize the denominator if needed.

Worked Examples

Example 1. Find the distance between the point and the line .

Solution. Rewrite the line equation:

Here , , , , :

Example 2. Find the distance between the parallel lines and .

Solution. Since the two lines have equal slopes, the distance between them is constant. Choose any convenient point on the second line. Setting :

So lies on the second line. Now apply the formula with the first line , where , , , , :

The distance between the two parallel lines is .

Frequently Asked Questions

Why is the distance formula measured perpendicularly?

The perpendicular distance is the shortest distance from a point to a line. Any other path from the point to the line is longer than the perpendicular segment. This makes the perpendicular distance the natural and most meaningful measure of how far the point is from the line.


How do I rewrite a line equation in the form ax + by + c = 0? Move all terms to one side of the equation. For example:
  • becomes (so , , ).
  • becomes (so , , ).
The coefficients , , can be any real numbers, as long as and are not both zero.

How do I find the distance between two parallel lines? Choose any point on one line, then compute its perpendicular distance to the other line using the formula. The result is the constant distance between the lines. This works because all perpendicular distances between parallel lines are equal.

What if the point lies on the line? If lies on the line , then . The numerator of the distance formula is zero, so . This makes sense: the distance from a point to a line it belongs to is zero.

What does the denominator √(a² + b²) represent? The expression is the magnitude (length) of the normal vector to the line . The normal vector is perpendicular to the line. Dividing by its magnitude normalizes the projection calculation, ensuring the result is a true geometric distance rather than a scaled value.