Equation of a Line

Every straight line you can draw is captured by one tidy linear-function template:

y = mx + c

Just two numbers steer the whole line: m is the gradient (how steeply it tilts) and c is the y-intercept (where it crosses the y-axis). Change either one and the line tilts or slides.

c — where the line crosses the y-axis

The number c is the y-intercept. At the crossing point x = 0, so

y = m(0) + c = c.

The line therefore always passes through the point (0, c). Raising c lifts the whole line up; lowering it drops the line down — without changing its tilt.

m — how steeply the line tilts

The number m is the gradient: it sets how steeply the line rises or falls. A bigger m tilts the line up more sharply; a negative m tips it downhill; m = 0 leaves it perfectly flat. (Gradient is measured precisely as slope.)

Drive the two sliders and watch how m and c shape the line.

Reading a line's equation

Given a line in this form you can read its two facts straight off. For y = 3x - 2 the gradient is m = 3 and the y-intercept is c = -2, so the line climbs steeply and crosses the axis at (0, -2).

To find y at a particular x, just substitute the value in. At x = 2: y = 3(2) - 2 = 4.

Khan Academy introduces slope-intercept form here: