Road engineers, video game designers, and architects all care about one big idea: how steep something is. If a ramp keeps the same steepness all the way up, then no matter which two points you pick on that ramp, the steepness should match. In coordinate geometry, that steepness is called slope, and one of the most powerful facts in algebra is that a straight, non-vertical line has one constant slope everywhere on the line.
On a coordinate plane, the slope of a line compares vertical change to horizontal change. If you move from one point to another, the vertical change is called the rise and the horizontal change is called the run.
Slope is the ratio of vertical change to horizontal change between two distinct points on a non-vertical line.
If the points are \((x_1, y_1)\) and \((x_2, y_2)\), then the slope is
\[m = \frac{y_2 - y_1}{x_2 - x_1}\]
This formula works only when \(x_2 - x_1 \neq 0\), which means the line is not vertical.
If the rise is positive, the line goes up from left to right, so the slope is positive. If the rise is negative, the line goes down from left to right, so the slope is negative. A horizontal line has rise \(0\), so its slope is \(0\). A vertical line has run \(0\), so its slope is undefined because division by \(0\) is not allowed.
Suppose two points on a line are \((1, 3)\) and \((5, 11)\). The rise is \(11 - 3 = 8\), and the run is \(5 - 1 = 4\). So the slope is \(\dfrac{8}{4} = 2\). That means for every \(1\) unit you move right, the line goes up \(2\) units.
That simple idea becomes much more important when we ask a deeper question: why should the slope be the same no matter which pair of points we choose on the same line?
An argument using similar triangles gives the reason. When we choose two different pairs of distinct points on the same non-vertical line and draw horizontal and vertical segments, we create right triangles. Because the triangles sit on the same line, they share the same acute angle with the horizontal axis, so the triangles are similar.
[Figure 1] Similar triangles have the same angle measures, and their corresponding side lengths are proportional. That means the ratio of vertical side to horizontal side is the same in both triangles. But that ratio is exactly rise over run, which is slope.
Here is the geometric idea. Take a non-vertical line. Pick two points on it, then make a right triangle by moving horizontally and vertically between those points. Now pick a different pair of points on the same line and make a second right triangle. Since both triangles are right triangles and each has the same acute angle made by the line, they are similar by angle-angle similarity.

If the first triangle has rise \(r_1\) and run \(u_1\), and the second has rise \(r_2\) and run \(u_2\), then similarity tells us
\[\frac{r_1}{u_1} = \frac{r_2}{u_2}\]
So the slope from the first pair of points equals the slope from the second pair of points. This is why a straight non-vertical line has one constant slope.
This fact matters because it means slope is a property of the line itself, not just a property of one carefully chosen pair of points. Later, when we write equations like \(y = mx\) or \(y = mx + b\), the letter \(m\) represents that same constant slope everywhere on the line.
Why "distinct points" matters
To calculate slope, we need a change in both coordinates between two points. If the two points were actually the same point, then both the rise and the run would be \(0\), and the expression \(\dfrac{0}{0}\) does not define a slope. That is why slope is taken between two distinct points.
Notice also why the line must be non-vertical. On a vertical line, any two points have the same \(x\)-coordinate, so the run is \(0\). Then the slope formula would require dividing by \(0\), which is undefined.
As we saw with the two triangles in [Figure 1], the constant ratio is really a constant rate of change. Whether the line is short or long, steep or gentle, its rise-to-run ratio stays fixed.
[Figure 2] A line through the origin has a special property: it passes through \((0, 0)\). On such a line, every point \((x, y)\) makes the same ratio \(\dfrac{y}{x}\) as long as \(x \neq 0\). That constant ratio is the slope, and the triangles formed from the origin to different points on the line all have the same shape.
Because the line passes through the origin, the rise from \((0,0)\) to \((x,y)\) is just \(y\), and the run is just \(x\). So the slope is
\[m = \frac{y}{x}\]
Now multiply both sides by \(x\):
\(y = mx\)
[Figure 2] This equation tells us that on a line through the origin, the \(y\)-value is always \(m\) times the \(x\)-value. That means the relationship is proportional. If \(x\) doubles, then \(y\) doubles too. If \(x\) triples, then \(y\) triples.

This is why a proportional relationship graphs as a straight line through the origin. The constant of proportionality is the same as the slope. For example, if \(m = 3\), then the equation is \(y = 3x\). The points \((1,3)\), \((2,6)\), and \((4,12)\) all lie on the line because each one satisfies the equation.
In earlier work with proportional relationships, you may have used equations like \(y = kx\), where \(k\) is the constant of proportionality. In graphing linear relationships, that same constant is the slope, so \(k\) and \(m\) play the same role in a line through the origin.
If a line through the origin has slope \(-\dfrac{1}{2}\), then every time \(x\) increases by \(2\), \(y\) decreases by \(1\). The equation becomes \(y = -\dfrac{1}{2}x\). Negative slope still follows the same rule: \(y\) changes by a constant amount compared to \(x\).
The repeated triangles in [Figure 2] make this visible. No matter which point on the line you choose, the ratio of rise to run stays equal to \(m\), so the equation \(y = mx\) fits every point on the line.
[Figure 3] Not all lines pass through the origin. Instead, they cross the y-axis at some value \(b\). This point is called the y-intercept. A line with slope \(m\) and y-intercept \(b\) starts at \((0, b)\), and then rises or falls at a constant rate.
Pick any point \((x, y)\) on the line. Compare it to the y-intercept point \((0, b)\). The rise from \((0,b)\) to \((x,y)\) is \(y - b\), and the run is \(x\). Since slope is rise over run, we have
\[m = \frac{y - b}{x}\]
Now multiply both sides by \(x\):
\(mx = y - b\)
Add \(b\) to both sides:
\(y = mx + b\)
This equation is called slope-intercept form. It is one of the most useful ways to describe a line. The slope \(m\) tells how steep the line is, and \(b\) tells where the line crosses the y-axis.

You can think of \(y = mx + b\) as a shifted version of \(y = mx\). The part \(mx\) controls the repeated rise-and-run pattern. The extra \(b\) moves the whole line up or down. If \(b\) is positive, the line crosses above the origin. If \(b\) is negative, it crosses below the origin.
For example, the line \(y = 2x + 3\) has slope \(2\) and y-intercept \(3\). It starts at \((0,3)\). From there, moving right \(1\) means moving up \(2\), so more points are \((1,5)\), \((2,7)\), and \((3,9)\).
Later, when you compare equations and graphs, the picture in [Figure 3] helps explain why changing \(m\) changes steepness while changing \(b\) changes the starting height on the y-axis.
Worked examples make the ideas more concrete. Pay attention to how each solution uses rise, run, slope, and intercept.
Worked Example 1: Find the slope between two points
Find the slope of the line through \((2, 1)\) and \((6, 9)\).
Step 1: Write the slope formula.
\(m = \dfrac{y_2 - y_1}{x_2 - x_1}\)
Step 2: Substitute the coordinates.
\(m = \dfrac{9 - 1}{6 - 2} = \dfrac{8}{4}\)
Step 3: Simplify.
\(m = 2\)
The slope is \(2\).
This result means the line goes up \(2\) units for every \(1\) unit you move to the right.
Worked Example 2: Write the equation of a line through the origin
A line passes through the origin and the point \((4, 10)\). Find its equation.
Step 1: Find the slope using the origin \((0,0)\) and \((4,10)\).
\(m = \dfrac{10 - 0}{4 - 0} = \dfrac{10}{4} = \dfrac{5}{2}\)
Step 2: Use the form for a line through the origin.
Since the line passes through \((0,0)\), its equation is \(y = mx\).
Step 3: Substitute the slope.
\[y = \frac{5}{2}x\]
The equation is \(y = \dfrac{5}{2}x\).
You can check by substituting \(x = 4\): then \(y = \dfrac{5}{2} \cdot 4 = 10\), which matches the given point.
Worked Example 3: Write the equation from slope and y-intercept
A line has slope \(-3\) and y-intercept \(4\). Find the equation.
Step 1: Recall slope-intercept form.
\(y = mx + b\)
Step 2: Substitute \(m = -3\) and \(b = 4\).
\(y = -3x + 4\)
The equation is \(y = -3x + 4\).
This means the line crosses the y-axis at \((0,4)\) and goes down \(3\) units for each \(1\) unit you move right.
Worked Example 4: Find the equation from two points not through the origin
Find the equation of the line through \((1, 2)\) and \((3, 8)\).
Step 1: Find the slope.
\(m = \dfrac{8 - 2}{3 - 1} = \dfrac{6}{2} = 3\)
Step 2: Use \(y = mx + b\).
Substitute \(m = 3\), so \(y = 3x + b\).
Step 3: Use one point to find \(b\).
Substitute \((1,2)\): \(2 = 3(1) + b\), so \(2 = 3 + b\), which gives \(b = -1\).
Step 4: Write the final equation.
\(y = 3x - 1\)
The equation is \(y = 3x - 1\).
Checking with the second point: if \(x = 3\), then \(y = 3(3) - 1 = 8\), so the equation is correct.
One common mistake is mixing up rise and run. Slope is always vertical change divided by horizontal change, not the other way around.
Another common mistake is thinking every linear equation must look like \(y = mx\). That form works only when the line passes through the origin. If the line crosses the y-axis anywhere else, the equation must include \(b\): \(y = mx + b\).
A horizontal line has equation \(y = b\). Its slope is \(0\) because the rise is always \(0\). For example, \(y = 5\) is a horizontal line crossing the y-axis at \(5\).
A vertical line has equation \(x = a\). It does not have a slope because the run is always \(0\). For example, \(x = -2\) is vertical and has undefined slope.
| Type of line | Example equation | Slope | Key feature |
|---|---|---|---|
| Line through origin | \(y = 2x\) | \(2\) | Passes through \((0,0)\) |
| Line with y-intercept | \(y = 2x + 3\) | \(2\) | Crosses y-axis at \(3\) |
| Horizontal line | \(y = 5\) | \(0\) | No vertical change |
| Vertical line | \(x = -2\) | Undefined | No horizontal change |
Table 1. Comparison of common types of lines and their slopes.
Linear equations are not just graphing rules. They describe situations where one quantity changes at a constant rate.
Suppose a bicycle rental costs $8 to unlock and then $3 per hour. If \(x\) is the number of hours and \(y\) is the total cost, then the equation is \(y = 3x + 8\). The slope \(3\) means the cost increases by $3 each hour, and the intercept \(8\) is the starting fee.
A ramp built to accessibility standards must have a steady steepness. If the ramp rises \(1\) foot for every \(12\) feet of horizontal distance, the slope is \(\dfrac{1}{12}\). Because the steepness stays constant, the ramp forms similar right triangles all along its length, just like the line triangles in [Figure 1].
Modern computer graphics often use slope-like ideas to decide how to draw straight edges on a screen. Even though the screen is made of tiny square pixels, constant rate of change helps software keep a line looking straight.
In science, a graph might show distance versus time for an object moving at constant speed. If the graph is a line through the origin, then distance is proportional to time and fits \(y = mx\). If the object had a head start, the graph could fit \(y = mx + b\), where \(b\) is the starting distance.
In business, a company may have a fixed monthly fee plus a charge per item produced. That pattern is exactly the structure of \(y = mx + b\): a constant rate \(m\) and a starting amount \(b\).
"A straight line is the graph of a constant rate of change."
Once you understand why similar triangles force the rise-to-run ratio to stay constant, the equations of lines become much more than memorized formulas. They become descriptions of patterns that appear in engineering, economics, transportation, and data graphs.