- Foundation
- About 15 min
- 5 practice questions
Equations of a line and distance from a line
Write the equation of a line in point-slope, two-point, slope-intercept, intercept and general form, read off its slope, and find the distance of a point from a line and between parallel lines.
If something looks wrong, please tell us.
A line is the set of all points (x, y) that satisfy one equation of the first degree. Once you have that equation, you can test whether a point lies on the line, find where the line meets the axes, and measure how far any point is from it. This lesson collects the standard forms of the equation and the distance formula that goes with them.
Horizontal and vertical lines
Every point on a horizontal line has the same y-coordinate, so its equation is y = b. Every point on a vertical line has the same x-coordinate, so its equation is x = a. The x-axis itself is y = 0 and the y-axis is x = 0.
The standard forms
| Form | Equation | Use it when you know |
|---|---|---|
| Point-slope | y − y₁ = m(x − x₁) | one point (x₁, y₁) and the slope m |
| Two-point | y − y₁ = [(y₂ − y₁)/(x₂ − x₁)](x − x₁) | two points |
| Slope-intercept | y = mx + c | the slope m and the y-intercept c |
| Intercept | x/a + y/b = 1 | the x-intercept a and the y-intercept b (both non-zero) |
| General | Ax + By + C = 0 | any line; A and B not both zero |
All forms describe the same kind of object, and any of them can be rearranged into the general form. From the general form Ax + By + C = 0 with B ≠ 0, the slope is −A/B and the y-intercept is −C/B. With A ≠ 0, the x-intercept is −C/A.
Worked example 1: three lines
(a) Through (2, 3) with slope 4: y − 3 = 4(x − 2), so y = 4x − 5, or 4x − y − 5 = 0. (b) Through (1, 2) and (3, 8): the slope is (8 − 2)/(3 − 1) = 3, so y − 2 = 3(x − 1), giving 3x − y − 1 = 0. Check with the second point: 3 × 3 − 8 − 1 = 0. (c) With x-intercept 3 and y-intercept −2: x/3 + y/(−2) = 1. Multiply by 6: 2x − 3y = 6, or 2x − 3y − 6 = 0.
Always check an equation by substituting the given points. If a point does not satisfy the equation, there is a slip in the working.
Reading the slope from the general form
For 2x − 3y + 6 = 0, solve for y: 3y = 2x + 6, so y = (2/3)x + 2. The slope is 2/3 and the y-intercept is 2, which matches −A/B = −2/(−3) = 2/3 and −C/B = −6/(−3) = 2. Two lines in general form are parallel when their x and y coefficients are in the same ratio, for example 3x + 4y − 5 = 0 and 3x + 4y + 10 = 0.
Distance of a point from a line
The distance of a point from a line means the shortest distance, measured along the perpendicular. There is a direct formula for it.
Distance of (x₁, y₁) from Ax + By + C = 0: d = |Ax₁ + By₁ + C| / √(A² + B²). Distance between parallel lines Ax + By + C₁ = 0 and Ax + By + C₂ = 0: d = |C₁ − C₂| / √(A² + B²).
Worked example 2: distances
(a) Distance of (3, 4) from 3x + 4y − 5 = 0: d = |3 × 3 + 4 × 4 − 5| / √(9 + 16) = |9 + 16 − 5| / 5 = 20/5 = 4. (b) Distance between 3x + 4y − 5 = 0 and 3x + 4y + 10 = 0: d = |−5 − 10| / 5 = 3. For the second formula, the x and y coefficients of the two lines must be written the same; if one line is 6x + 8y + 20 = 0, divide it by 2 first.
Key takeaways: choose the form that matches the information given, then convert to Ax + By + C = 0. The slope of Ax + By + C = 0 is −A/B. Substitute given points to check. Use d = |Ax₁ + By₁ + C| / √(A² + B²) for the distance from a point, and match coefficients before using the parallel-lines formula.
Check your understanding
-
1. What is the equation of the line with slope 2 and y-intercept −3?
- y = −3x + 2
- y = 2x + 3
- 2y = x − 3
- y = 2x − 3
Show answer
Answer: D. Slope-intercept form y = mx + c with m = 2 and c = −3.
-
2. What is the equation of the line through (1, −1) and (3, 5)?
- y = 3x + 4
- y = 3x − 4
- y = 2x − 3
- y = x − 2
Show answer
Answer: B. Slope = (5 − (−1))/(3 − 1) = 3. y + 1 = 3(x − 1), so y = 3x − 4. Check: 3 × 3 − 4 = 5.
-
3. What is the slope of the line 2x − 3y + 6 = 0?
- −2/3
- 3/2
- 2
- 2/3
Show answer
Answer: D. Slope = −A/B = −2/(−3) = 2/3.
-
4. What is the distance of the point (1, 2) from the line 4x + 3y − 20 = 0?
- 10
- 4
- 2
- 10/7
Show answer
Answer: C. |4 × 1 + 3 × 2 − 20| / √(16 + 9) = |−10| / 5 = 2.
-
5. What is the distance between the parallel lines 6x − 8y + 3 = 0 and 6x − 8y − 7 = 0?
- 1
- 2
- 1/2
- 10
Show answer
Answer: A. |3 − (−7)| / √(36 + 64) = 10/10 = 1.
Sign in to keep track of the lessons you finish.