Distance from a Point to a Line
Distance from a Point to a Line
The length of the shortest segment from a given point to a given line. A formula is given below.

See also
Key Formula
d=A2+B2∣Ax0+By0+C∣
Where:
- d = The perpendicular distance from the point to the line
- (x0,y0) = The coordinates of the given point
- A = The coefficient of x in the line's standard form Ax + By + C = 0
- B = The coefficient of y in the line's standard form Ax + By + C = 0
- C = The constant term in the line's standard form Ax + By + C = 0
Worked Example
Problem: Find the distance from the point (2, 3) to the line 3x + 4y − 6 = 0.
Step 1: Identify A, B, C from the line equation and the point coordinates. The line is 3x + 4y − 6 = 0, so A = 3, B = 4, C = −6. The point is (x₀, y₀) = (2, 3).
A=3,B=4,C=−6,(x0,y0)=(2,3)
Step 2: Substitute into the numerator of the formula: |Ax₀ + By₀ + C|.
∣3(2)+4(3)+(−6)∣=∣6+12−6∣=∣12∣=12
Step 3: Compute the denominator: the square root of A² + B².
32+42=9+16=25=5
Step 4: Divide the numerator by the denominator to get the distance.
d=512=2.4
Answer: The distance from (2, 3) to the line 3x + 4y − 6 = 0 is 2.4 units.
Another Example
This example starts with the line in slope-intercept form (y = mx + b), so an extra conversion step to standard form is required before applying the formula.
Problem: Find the distance from the point (−1, 5) to the line y = 2x + 3.
Step 1: Convert the line equation from slope-intercept form to standard form Ax + By + C = 0. Rearrange y = 2x + 3 by subtracting y from both sides.
2x−y+3=0⇒A=2,B=−1,C=3
Step 2: Substitute the point (−1, 5) into the numerator.
∣2(−1)+(−1)(5)+3∣=∣−2−5+3∣=∣−4∣=4
Step 3: Compute the denominator.
22+(−1)2=4+1=5
Step 4: Divide and rationalize the denominator if desired.
d=54=545≈1.789
Answer: The distance is 4√5 / 5 ≈ 1.789 units.
Frequently Asked Questions
Why does the distance formula use absolute value in the numerator?
The expression Ax₀ + By₀ + C can be positive or negative depending on which side of the line the point lies. Distance is always non-negative, so the absolute value ensures you get a positive result regardless of the point's position relative to the line.
Why is the shortest distance from a point to a line always perpendicular?
Among all segments connecting a point to a line, the perpendicular segment is the shortest. This follows from the Pythagorean theorem: any non-perpendicular segment forms the hypotenuse of a right triangle with the perpendicular segment as one leg, making it necessarily longer.
How do you find the distance from a point to a line in 3D?
In three dimensions, you use a vector approach. If the line passes through a point Q with direction vector d, and your point is P, then the distance is |QP × d| / |d|, where × denotes the cross product. The standard-form formula only applies to lines in a 2D plane.
Distance from a Point to a Line vs. Distance Between Two Points
| Distance from a Point to a Line | Distance Between Two Points | |
|---|---|---|
| Definition | Shortest (perpendicular) distance from a point to a line | Straight-line distance between two specific points |
| Formula | d = |Ax₀ + By₀ + C| / √(A² + B²) | d = √[(x₂−x₁)² + (y₂−y₁)²] |
| Inputs needed | One point and one line equation | Two points (four coordinates) |
| Result direction | Always perpendicular to the line | Along the segment connecting the two points |
Why It Matters
This formula appears frequently in coordinate geometry problems on standardized tests and in analytic geometry courses. It is essential for computing the height of a triangle when you know a vertex and the equation of the opposite side, which in turn lets you find area. Beyond the classroom, the concept is used in computer graphics, GPS systems, and engineering to measure how far an object is from a boundary or path.
Common Mistakes
Mistake: Forgetting to convert the line equation to standard form (Ax + By + C = 0) before applying the formula.
Correction: If the line is given as y = mx + b, first rewrite it as mx − y + b = 0 so you can correctly identify A, B, and C. Using the slope or intercept directly in the formula produces a wrong answer.
Mistake: Omitting the absolute value in the numerator and getting a negative distance.
Correction: Distance is always non-negative. The signed value Ax₀ + By₀ + C tells you which side of the line the point is on, but the distance requires taking its absolute value.
Related Terms
- Line Segment — The distance itself is a segment length
- Point — One of the two geometric objects involved
- Line — The other geometric object involved
- Standard Form for the Equation of a Line — The line must be in this form for the formula
- Formula — General term for algebraic expressions like this
- Distance Formula — Measures distance between two points instead
- Perpendicular — The shortest distance is always perpendicular to the line
- Area of a Triangle — Point-to-line distance gives the triangle's height
