Slope in this visualization
The slope of a line measures how steep it is. Take two points on the line with different -coordinates, and . Going from P to Q, the line rises while it runs , and its slope is rise over run:
Slope is usually written ; is also common. In the equation of a line that is not vertical, 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 for every unit across, or down when 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, . The signs agree too, since both ratios are positive on a line that rises and negative on one that falls: . 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 and , 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 , the steeper the line.
On a vertical line , 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 runs from the positive -direction to the line, . For a line that is not vertical, ; a vertical line has , 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.