notesonly.in

One notebook for every subject — open it anywhere.

Log in

Distance of a Point from a Line: Explained with Examples

The distance of a point from a line is the length of the shortest segment joining them — which is always the perpendicular dropped from the point to the line. For a point P(x1, y1) and the line ax + by + c = 0, that distance is |ax1 + by1 + c|/√(a² + b²).

It matters because "how far am I from this boundary?" is one of the most asked geometric questions: a ship's distance from a straight coastline, a robot's clearance from a wall, or whether a point lies inside a safety zone around a road. The perpendicular is the shortest path, so this formula gives the true clearance.

Key Concepts

  • Perpendicular is shortest: among all segments from the point to the line, the perpendicular one is the minimum — that is the distance.
  • Numerator |ax1 + by1 + c|: plug the point into the line's left side; its sign tells which side of the line the point lies on.
  • Denominator √(a² + b²): the length of the normal vector (a, b), which converts the raw value into a true length.
  • Zero distance: if the point satisfies the line's equation, the numerator is zero — the point lies on the line.
  • Units: the result is a length in the coordinate units.

Formulas

  • d = |ax1 + by1 + c|/√(a² + b²) — the perpendicular distance from P(x1, y1) to the line ax + by + c = 0.
  • Distance from the origin: set (x1, y1) = (0, 0) to get d = |c|/√(a² + b²).
  • Foot of perpendicular: the nearest point on the line is found by moving from P along the normal direction (a, b) by the signed distance −(ax1+by1+c)/(a²+b²) times (a, b).

Assumptions: the line is in general form with (a, b) ≠ (0, 0), on a flat plane. Limits: this is the straight-line clearance only; the distance along a road network or around obstacles needs different methods.

Worked Example

Find the distance of the point P(4, 5) from the line 3x + 4y − 24 = 0.

  1. Identify a = 3, b = 4, c = −24, and the point (x1, y1) = (4, 5).
  2. Numerator: |ax1 + by1 + c| = |3·4 + 4·5 − 24| = |12 + 20 − 24| = |8| = 8.
  3. Denominator: √(a² + b²) = √(9 + 16) = √25 = 5.
  4. Distance d = 8/5 = 1.6 units.
  5. Check via the foot of perpendicular: it works out to (3.04, 3.72); substituting in 3x + 4y − 24 gives 9.12 + 14.88 − 24 = 0, and its distance from P is √((0.96)² + (1.28)²) = √2.56 = 1.6. Confirmed.

Common Misconceptions

  • "Any segment from the point to the line gives the distance." Only the perpendicular segment is the distance; a slanted segment is always longer.
  • "The absolute value is optional." Without it you get a signed distance — fine for side-testing, but a distance must be non-negative.
  • "The formula needs the line in y = mx + c form." It needs general form ax + by + c = 0; convert first (for y = mx + c, rewrite as mx − y + c = 0).

Real-World Applications

  • Navigation systems warn when a vehicle drifts too far from a straight road centreline.
  • Manufacturing checks whether a drilled hole's centre is within tolerance of its intended line.
  • Computer graphics computes how far a cursor is from a drawn line for selection tools.
  • Sports analytics measures a player's distance from boundary lines and offside lines.

The distance from a point to a line is the perpendicular length |ax1 + by1 + c|/√(a² + b²). Plug in the point, take the absolute value, divide by the normal's length — and you have the shortest, true clearance every time.