Your Equation

Library / Foundations: Maths / FMA-03

Foundations: Maths

Gradient of a straight line

Rise over run between two points, and the line y = mx + c.

Ref
FMA-03
Rev
v1
Field
Foundations: Maths
Result
m

m is the gradient (rise ÷ run) and c the intercept on the y axis. Vertical lines have undefined gradient.

The gradient says how steeply a line rises: how much y changes for each unit of x. It is the rise divided by the run between any two points.

Calculator

Solve for
−1020
030
03
410
  • Intercept c = y₁ − m x₁−1
  • Angle to the x axis63.43 °

What drives the result

Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.

Gradient () current value 2
y1First yKey driver
−2.754.75
y2Second y
−0.257.25
x1First x
1.64
x2Second x
0.8892.67
  • Gradient has units: it is (units of y) per (unit of x), such as m/s on a distance–time graph.
  • Steeper lines have bigger gradients; a negative gradient means y falls as x rises.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing ()Local stepChange in result
y1 First y−10 to 20 −2.754.757.5+10%−1.25 %
y2 Second y0 to 30 −0.257.257.5+10%+11.3 %
x1 First x0 to 3 1.642.4+10%+2.56 %
x2 Second x4 to 10 0.88892.6671.778+10%−11.1 %

Sweep of Second y

Second yGradient
0−0.25
3.750.6875
7.51.625
11.252.563
153.5
18.754.438
22.55.375
26.256.313
307.25

Sweep one variable

Gradient ()Hover, touch, or use the arrow keys on the chart
0246 051015202530 Second y now 2

Variables and how each one contributes

m

Gradient

Result ·

What the equation gives you. Everything else feeds it.

y1

First y

· typical −10 to 20

y value of the first point. Lowers the gradient as it rises.

y2

Second y

· typical 0 to 30

y value of the second point. Raises the gradient.

x1

First x

· typical 0 to 3

x value of the first point. Shortens the run, so a larger x₁ steepens the line.

x2

Second x

· typical 4 to 10

x value of the second point. Lengthens the run and lowers the gradient.

Worked example with the values above

  1. Rise: y₂ − y₁ = 9 − 1 = 8. Run: x₂ − x₁ = 4.
  2. m = rise/run = 8 / 4.
  3. Gradient 2.

Assumptions and limits

  • The graph is a straight line.
  • The scales on both axes are read in their stated units.

Common mistakes

  • Reading run as x₁ − x₂ with rise as y₂ − y₁.
  • Ignoring the units of the axes.

Statistics and uncertainty

When the two points are close together, small errors in the readings are divided by a small run and the gradient becomes unreliable; use points far apart on the line.

Where it is used

  • Speed from a distance–time graph.
  • Calibration lines for sensors.

Maths you need

  • Coordinates: points on a graph
  • Division: rise divided by run

Related formulas

Practise this formula