Mathematical concepts
Gradient of a straight line
Also called: slope · y = mx + c · rate of change · linear model
Definition
The gradient of a straight line is the change in y divided by the change in x between any two points on it; in y = mx + c it is m, and c is where the line crosses the y-axis.
Picture it
Gradient is a rate with units: metres per second on a distance–time graph, ohms on a voltage–current graph. Calibrating a sensor often means finding m and c so that a raw reading converts to a real quantity.
The maths
m = (y2 − y1) / (x2 − x1) y = m x + c
| Quantity | Unit | Symbol |
|---|---|---|
| ratio | dimensionless | 1 |
| voltage | volt | V |
| resistance | ohm | Ω |
Worked example
A temperature sensor gives 0.50 V at 0 °C and 1.50 V at 100 °C. Find the calibration line and the temperature at 0.86 V.
- m = (1.50 − 0.50) / (100 − 0) = 0.01 V/°C
- c = 0.50 V
- T = (0.86 − 0.50) / 0.01 = 36 °C
AnswerV = 0.01 T + 0.50; 0.86 V means 36 °C.
✓ The 2 numbers in this answer are recomputed from scratch by an automated test.
Common misconceptions
- Misconception: The gradient has units; a slope of 0.01 means nothing without V/°C.
- Misconception: Two points always fit a line, so they cannot tell you whether the relationship really is linear.