Slope of a line
The slope (or gradient) tells how steep a line is. Walk along the line from one point to another. The change in y is the rise. The change in x is the run.
m = rise ÷ run = (y₂ − y₁)/(x₂ − x₁). If the line makes angle θ with the positive x-axis, then m = tan θ (θ ≠ 90°).
- Line going up to the right: m > 0. Going down: m < 0.
- Flat line (parallel to x-axis): m = 0.
- Standing line (parallel to y-axis): slope is not defined.
Parallel, perpendicular and collinear
Two lines are parallel when their slopes are equal: m₁ = m₂. They are perpendicular when m₁ × m₂ = −1 (neither line vertical). Three points A, B, C lie on one line (collinear) when slope AB = slope BC.
Angle between two lines
Two crossing lines make two angles that add to 180°. If the slopes are m₁ and m₂ and 1 + m₁m₂ ≠ 0, the acute angle θ is found from
tan θ = |(m₂ − m₁)/(1 + m₁m₂)|
The other angle is 180° − θ. If 1 + m₁m₂ = 0 the lines are perpendicular (θ = 90°).
Forms of the equation of a line
The equation of a line is a rule that every point on the line obeys, and no other point does.
- Parallel to the x-axis: y = b. Parallel to the y-axis: x = a. (The x-axis itself is y = 0.)
- Point-slope form: y − y₁ = m(x − x₁), through (x₁, y₁) with slope m.
- Slope-intercept form: y = mx + c, where c is the y-intercept. (If the x-intercept is d, then y = m(x − d).)
- Two-point form: y − y₁ = [(y₂ − y₁)/(x₂ − x₁)](x − x₁).
- Intercept form: x/a + y/b = 1, cutting a on the x-axis and b on the y-axis.
Every line can be written as Ax + By + C = 0 (general form). Its slope is −A/B and its y-intercept is −C/B.
Distance of a point from a line
The shortest way from a point to a line is the perpendicular. For point P(x₁, y₁) and line Ax + By + C = 0:
d = |Ax₁ + By₁ + C| / √(A² + B²)
Two parallel lines Ax + By + C₁ = 0 and Ax + By + C₂ = 0 are a fixed distance apart: d = |C₁ − C₂| / √(A² + B²). Make sure A and B are the same in both lines before using it.
Key formulas and definitions
- m = (y₂ − y₁)/(x₂ − x₁) = tan θ
- Parallel: m₁ = m₂; Perpendicular: m₁m₂ = −1
- tan θ = |(m₂ − m₁)/(1 + m₁m₂)|
- y − y₁ = m(x − x₁)
- y = mx + c
- y − y₁ = [(y₂ − y₁)/(x₂ − x₁)](x − x₁)
- x/a + y/b = 1
- d = |Ax₁ + By₁ + C| / √(A² + B²)
- d (parallel lines) = |C₁ − C₂| / √(A² + B²)
Worked examples
1. Find the slope of the line through (2, −3) and (6, 5), and the angle it makes with the x-axis.
Step 1: m = (5 − (−3))/(6 − 2) = 8/4 = 2. Step 2: tan θ = 2, so θ = tan⁻¹ 2 ≈ 63.4°.
2. Show that A(1, 2), B(3, 6) and C(4, 8) are collinear.
Step 1: slope AB = (6 − 2)/(3 − 1) = 2. Step 2: slope BC = (8 − 6)/(4 − 3) = 2. Step 3: equal slopes and B is common, so A, B, C lie on one line.
3. Find the equation of the line through (−1, 4) with slope −3.
Step 1: point-slope form y − 4 = −3(x + 1). Step 2: y − 4 = −3x − 3. Step 3: y = −3x + 1, or 3x + y − 1 = 0.
4. Find the equation of the line through (1, −1) and (3, 5).
Step 1: m = (5 + 1)/(3 − 1) = 3. Step 2: y + 1 = 3(x − 1). Step 3: y = 3x − 4, or 3x − y − 4 = 0.
5. A line cuts off intercepts 6 and −4 on the x- and y-axes. Find its equation.
Step 1: intercept form x/6 + y/(−4) = 1. Step 2: multiply by 12: 2x − 3y = 12. Step 3: 2x − 3y − 12 = 0.
6. Find the acute angle between y = 2x + 1 and y = −3x + 5.
Step 1: m₁ = 2, m₂ = −3. Step 2: tan θ = |(−3 − 2)/(1 + 2(−3))| = |−5/−5| = 1. Step 3: θ = 45°.
7. Find the distance of (2, 3) from the line 5x − 12y + 7 = 0.
Step 1: d = |5(2) − 12(3) + 7| / √(25 + 144). Step 2: = |10 − 36 + 7| / 13 = |−19| / 13. Step 3: d = 19/13 ≈ 1.46 units.
8. Find the distance between the parallel lines 3x − 4y + 7 = 0 and 6x − 8y − 1 = 0.
Step 1: make A, B equal: divide the second by 2 → 3x − 4y − 1/2 = 0. Step 2: d = |7 − (−1/2)| / √(9 + 16) = (15/2)/5. Step 3: d = 3/2 = 1.5 units.
9. Find the equation of the line through (2, 3) perpendicular to 4x − 3y + 5 = 0.
Step 1: slope of given line = −A/B = 4/3. Step 2: perpendicular slope = −3/4. Step 3: y − 3 = −3/4 (x − 2) → 4y − 12 = −3x + 6 → 3x + 4y − 18 = 0.
Common mistakes
- Writing slope as run ÷ rise. It is always (change in y) ÷ (change in x).
- Mixing the order: (y₂ − y₁)/(x₁ − x₂). Take both differences in the same order.
- Using |C₁ − C₂| for parallel lines without first making A and B the same in both equations.
- Forgetting the absolute value in the distance formula and getting a negative distance.