Algebra & Functions · Slope

Slope

The steepness of a line: pick two different points on it and divide the rise by the run, m = Δy/Δx. On a line that is not vertical every such pair gives the same number; a vertical line has no slope.

Slope in this visualization

The slope of a line measures how steep it is. Take two points on the line with different xx-coordinates, P(x1,y1)P(x_1, y_1) and Q(x2,y2)Q(x_2, y_2). Going from P to Q, the line rises Δy=y2−y1\Delta y = y_2 - y_1 while it runs Δx=x2−x1\Delta x = x_2 - x_1, and its slope is rise over run:

Slope
m=ΔyΔx=y2−y1x2−x1,x1≠x2m = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}, \qquad x_1 \ne x_2

Slope is usually written mm; kk is also common. In the equation y=mx+by = mx + b of a line that is not vertical, mm is its slope. Here the run and the rise are the two legs of a right triangle, and the readout works the ratio out from the coordinates. A step of 1 to the right shows the same number as a rate: the line goes up mm for every unit across, or down when mm is negative.

Why any two points give the same slope

On a line that is neither vertical nor horizontal, the run-and-rise triangles between any two of its points have the same angles: their horizontal sides are parallel, their vertical sides are parallel, and their long sides lie on the same line. So the triangles are similar and their legs are in proportion, ∣Δy′∣/∣Δx′∣=∣Δy∣/∣Δx∣|\Delta y'|/|\Delta x'| = |\Delta y|/|\Delta x|. The signs agree too, since both ratios are positive on a line that rises and negative on one that falls: Δy′/Δx′=Δy/Δx\Delta y'/\Delta x' = \Delta y/\Delta x. Measure twice as far and the line rises twice as much. The slope belongs to the line, not to the two points you happened to pick. On a horizontal line every rise is 0, so every ratio is 0. Walking from Q to P instead flips the sign of both Δx\Delta x and Δy\Delta y, which leaves the ratio alone, and moving the whole line up or down changes neither difference.

Positive, negative, zero, undefined

A line that rises from left to right has a positive slope, one that falls has a negative slope, and a horizontal line has slope 0. The larger ∣m∣|m|, the steeper the line.

On a vertical line Δx=0\Delta x = 0, and rise over run cannot be formed: the slope of a vertical line is undefined. It is not infinite either. Turn a line towards vertical from one side and its slope grows past any number; from the other side it drops below any negative number. No single value fits the vertical line itself. Two points that coincide are a different matter: they do not fix a line at all.

Slope and angle

The angle of inclination θ\theta runs from the positive xx-direction to the line, 0∘≤θ<180∘0^\circ \le \theta < 180^\circ. For a line that is not vertical, m=tan⁡θm = \tan\theta; a vertical line has θ=90∘\theta = 90^\circ, where the tangent is undefined too. With the same scale on both axes, as here, this is the angle you see. Slope and angle are not proportional: slope 1 is 45°, slope 2 about 63.43°. On a graph whose axes have different scales, as many graphs of data do, the angle you see changes with the scales, while the slope, counted in the axes’ own units, does not.

Controls

  • A selected point moves with the arrow keys, 0.1 at a time (0.01 with Shift); R and T slide along the line.

Related