The equation of any straight line can be written in the form: $$y = mx + c$$ where $m$ is the gradient and $c$ is the $y$-intercept.
Finding the equation from two points:
- Calculate the gradient: $m = \frac{y_2 - y_1}{x_2 - x_1}$
- Substitute one point into $y = mx + c$ to find $c$
Example: Find the equation of the line through $(2, 5)$ and $(4, 11)$. $$m = \frac{11-5}{4-2} = 3, \quad 5 = 3(2) + c \implies c = -1$$ $$y = 3x - 1$$
Alternative form: $ax + by = c$ is sometimes used (e.g. $3x - y = 1$).
Vertical lines: $x = k$ (undefined gradient — not in $y = mx + c$ form). Horizontal lines: $y = k$ (gradient zero).
Common error: substituting into $y = mx + c$ and getting $c$ wrong because of arithmetic errors. Always substitute a point you're confident about, and check with the second point.
