coordinate geometry
Distance from a Point to a Line
You should know: coordinate plane
Overview
The distance from a point to a line is the length of the shortest path connecting them — which is always the perpendicular segment from the point to the line, never a slanted one. Given a line in the general form Ax + By + C = 0 and a point (x₁, y₁) not on it, a single closed-form formula computes this shortest distance directly from the coefficients and coordinates, without needing to first find the foot of the perpendicular. This formula is a two-dimensional cousin of the point-to-plane distance formula in 3D, and it underlies everything from finding the height of a triangle given its vertices to computing clearances in CAD and robotics.
Intuition
The vector ⟨A, B⟩ is normal (perpendicular) to the line Ax+By+C=0 — the same fact used for planes in 3D, one dimension down. To find how far a point is from the line, project the vector from any point on the line to P₁ onto this normal direction; the length of that projection is exactly the perpendicular distance, because the normal direction is the only direction along which distance to the line changes. The formula packages this projection into a single computation: plug the point's coordinates directly into the line's equation, take the absolute value, and divide by the normal vector's length to normalize for scale.
Formal Definition
For a line Ax + By + C = 0 and a point P₁ = (x₁, y₁), the perpendicular distance is:
The formula requires the line in this general form, not slope-intercept form
Derivation
Let Q = (x₀, y₀) be any point on the line, so Ax₀+By₀+C = 0. The vector from Q to P₁ is ⟨x₁-x₀, y₁-y₀⟩, and the normal to the line is n = ⟨A,B⟩. The distance is the magnitude of the scalar projection of QP₁ onto n:
Scalar projection of QP₁ onto the unit normal
Using Ax₀+By₀ = -C since Q lies on the line
Properties
Always shortest / perpendicular
Zero distance means on the line
Scale invariance
Sign of the numerator
Applications
Worked Examples
Identify A=3, B=-4, C=1, and substitute the point's coordinates.
Take the absolute value and divide by √(A²+B²).
Answer: d = 13/5 = 2.6
Practice Problems
Find the distance from the point (1, -2) to the line 5x + 12y - 3 = 0.
Find the distance from (4, 4) to the line 5x + 12y - 3 = 0, and check whether the point lies on the same side of the line as the origin.
Triangle ABC has A=(0,0), B=(6,0), C=(2,4). Using AB as the base (lying on the x-axis, i.e. the line y=0), find the triangle's area via the height from C.
Common Mistakes
Applying the formula d=|Ax₁+By₁+C|/√(A²+B²) using a line given in slope-intercept form y=mx+b without first converting to general form.
The formula requires the line written as Ax+By+C=0. Convert y=mx+b to mx - y + b = 0 (so A=m, B=-1, C=b) before substituting, or the coefficients A, B, C will be wrong.
Forgetting the absolute value and reporting a negative distance.
Distance is always non-negative; the absolute value in the numerator is essential. Without it, the signed value is still useful (its sign indicates which side of the line the point is on), but it isn't the distance itself.
Quiz
Summary
- The distance from point (x₁,y₁) to line Ax+By+C=0 is d = |Ax₁+By₁+C| / √(A²+B²).
- This distance is always measured along the perpendicular from the point to the line — the shortest possible path.
- The formula comes from projecting a vector to the point onto the line's normal vector ⟨A,B⟩.
- Dropping the absolute value gives a signed distance useful for determining which side of the line a point lies on.
Mathematics