The equation of a straight line
| English | Chinese | Pinyin |
|---|---|---|
| intercept | 截距 | jié jù |
| line of best fit | 最佳拟合线 | zuì jiā nǐ hé xiàn |
Reading a line like a barcode
- Every straight line has a unique "signature" — its equation.
- If you can read the equation, you can tell the gradient, the intercept 截距, and where the line crosses every axis — without drawing it.
- The signature is just three letters: $y = mx + c$.
The form $y = mx + c$
- $m$ is the gradient (how steep the line is).
- $c$ is the $y$-intercept (where the line crosses the $y$-axis — the point $(0, c)$).
- Together, they completely describe a straight line.

In $y = 3x - 1$: the gradient $m = 3$ and the intercept $c = -1$. The figure shows both.
The straight line
y = ax + b
Every line has a gradient a and a y-intercept b.
In y = mx + c, the letter m stands for the:
m is the gradient (steepness); c is the y-intercept.
Reading $m$ and $c$ from an equation
- When the equation is already in $y = mx + c$ form, just read off the values:
- $y = 5x + 2$ → $m = 5$, $c = 2$.
- $y = -\dfrac{1}{2}x + 4$ → $m = -\dfrac{1}{2}$, $c = 4$.
- $y = 3x$ → $m = 3$, $c = 0$ (the line passes through the origin).
Not in $y =$ form? You must rearrange first. $5x + 4y = 8$ looks tricky, but: $4y = -5x + 8$, so $y = -\dfrac{5}{4}x + 2$ — gradient $-\dfrac{5}{4}$, intercept $2$.

For $y=mx+c$ the line crosses the $y$-axis at $c$, and the gradient $m$ is the rise divided by the run
Finding the equation from a point and gradient
- Know the gradient $m$ and one point? Substitute into $y = mx + c$ and solve for $c$.
- Example: gradient $3$ through $(1, 2)$:
- $2 = 3(1) + c \Rightarrow c = 2 - 3 = -1$.
- The equation is $y = 3x - 1$.
From two points. Through $(2, 5)$ and $(4, 11)$: first find $m = \dfrac{11-5}{4-2} = \dfrac{6}{2} = 3$. Then $5 = 3(2) + c \Rightarrow c = -1$. Equation: $y = 3x - 1$.
A line has gradient 3 and passes through (1, 2). In y = 3x + c, what is c?
2 = 3(1) + c, so c = 2 − 3 = −1; the line is y = 3x − 1.
A line has gradient 2 and passes through (3, 1). Its equation is:
1 = 2(3) + c → c = 1 − 6 = −5. So y = 2x − 5.
A line is perpendicular to y = 2x + 3 and passes through (4, 1). In y = mx + c, what is c?
Perpendicular gradient = −1/2. So 1 = −(1/2)(4) + c → 1 = −2 + c → c = 3.
Rearranging to $y = mx + c$
- Exams love giving equations like $ax + by = c$ and asking for the gradient.
- Step 1: isolate $y$ — move $ax$ to the other side, then divide by $b$.
- Step 2: read off $m$ and the intercept.
- Example: $2x + 3y = 12 \Rightarrow 3y = -2x + 12 \Rightarrow y = -\dfrac{2}{3}x + 4$.
- Gradient $= -\dfrac{2}{3}$; $y$-intercept $= 4$.
Rearrange 5x + 4y = 8 into y = mx + c. What is c (the y-intercept)?
4y = −5x + 8, so y = −(5/4)x + 2; the intercept is 2.
Rearrange 2x + 3y = 12 into y = mx + c. What is the gradient m?
3y = −2x + 12, so y = −(2/3)x + 4. The gradient is −2/3 ≈ −0.667.
Rearrange 3x − y = 7 into y = mx + c. What is the y-intercept?
−y = −3x + 7, so y = 3x − 7. The y-intercept is −7.
The line of best fit 最佳拟合线
- In science experiments, data points rarely fall on a perfect line.
- Scientists draw a line of best fit through the scatter — and its equation $y = mx + c$ summarises the whole experiment in one sentence.
- The gradient tells you the rate (e.g. how fast temperature rises per minute); the intercept tells you the starting value.
Match each equation to its property.
y = 4x + 1: m = 4. y = −x + 3: c = 3. y = 2x: c = 0, so it passes through (0,0). y = 5x − 1 has gradient 5, same as y = 5x + 7, so they are parallel.
You've got it
- $y = mx + c$ — $m$ is the gradient, $c$ is the $y$-intercept
- rearrange $ax + by = c$ into $y = mx + c$ before reading off $m$ and $c$
- gradient $3$ through $(1, 2)$ → $c = -1$ → equation $y = 3x - 1$
- from two points: find $m$ first, then substitute one point to find $c$