On this page
Two points on a line are enough to find how steep it is. The slope tells you how much y changes for every one-unit step in x, and in Class 11 coordinate geometry much of the work on straight lines builds on it. Here are the formula, two worked examples, and the two cases that trip students up.
What is the formula for the slope of a line through two points?
For two points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁)/(x₂ − x₁): the change in y divided by the change in x (OpenStax College Algebra 2e). This is often called rise over run.
The same textbook explains the sign. A line with a positive slope rises from left to right, and a line with a negative slope falls from left to right (OpenStax College Algebra 2e).
Either point can come first, as long as you use the same order on the top and the bottom. Swap only one and the sign flips.
Worked example 1, a positive slope: find the slope of the line through A(2, 1) and B(6, 4).
Rise: y₂ − y₁ = 4 − 1 = 3.
Run: x₂ − x₁ = 6 − 2 = 4.
Slope: m = 3/4 = 0.75.
The line climbs 3 units for every 4 to the right. Reversing the order gives (1 − 4)/(2 − 6) = 3/4 again.
Worked example 2, a negative slope: through P(−1, 5) and Q(3, −3), m = (−3 − 5)/(3 − (−1)) = −8/4 = −2. The line drops 2 units for every 1 unit you move to the right. Watch the double minus in the denominator: 3 − (−1) is 4, not 2.
Why is the slope of a vertical line undefined?
Take two points on a vertical line, such as (3, 1) and (3, 7). The run is 3 − 3 = 0, so the formula asks you to divide 6 by 0. Division by zero has no value, which is why the slope of a vertical line is undefined (OpenStax College Algebra 2e).
A horizontal line is the opposite case. For (−2, 4) and (5, 4), the rise is 4 − 4 = 0, so m = 0/7 = 0. A line with a slope of zero is horizontal (OpenStax College Algebra 2e).
How is slope related to the angle of inclination?
The angle of inclination θ is the angle a line makes with the positive x-axis, and it lies in the range 0° ≤ θ < 180° (Siyavula Grade 11 Mathematics). For a line making an angle θ with the x-axis, the slope is m = Δy/Δx = tan θ (Wolfram MathWorld).
This one rule explains both special cases:
Horizontal line: θ = 0°, and tan 0° = 0, so m = 0.
Line rising from left to right: θ is between 0° and 90°, so tan θ is positive.
Vertical line: θ = 90°, and tan 90° is not defined, so the slope is undefined.
Line falling from left to right: θ is between 90° and 180°, so tan θ is negative.
To get the angle back from the slope, use θ = tan⁻¹(m). In example 1, tan⁻¹(0.75) ≈ 36.87°. In example 2, a calculator gives tan⁻¹(−2) ≈ −63.43°, which lies outside the allowed range. For a negative gradient, Siyavula's worked example adds 180° to the calculator's answer (Siyavula Grade 11 Mathematics), which gives θ ≈ 116.57° here.
What should you check before writing your slope answer?
Run through this list on every slope question:
Same order on top and bottom: if y₂ comes first in the numerator, x₂ comes first in the denominator.
Brackets around negatives: write 3 − (−1), not 3 − 1.
Run of zero: if x₂ = x₁, the line is vertical. Write that the slope is undefined, not 0.
Rise of zero: if y₂ = y₁, the slope is 0 and θ = 0°.
Negative slope: add 180° to the calculator's angle so that θ comes out obtuse.
Sense check: does the sign match a quick sketch? A line that falls from left to right cannot have a positive slope.
If you keep getting the sign wrong, try worked problems in the Fermi Problem Library. Its step-by-step solver explains the reasoning rather than printing an answer, so you can compare each step with your own working. If tan θ itself feels shaky, the Fermi Concept Library gives each concept in mathematics its own lesson and its place in the map.
Where does slope lead next?
Once slope feels easy, read how the point-slope and two-point forms give the equation of a line, why the slopes of perpendicular lines multiply to −1 and how equal slopes show that three points are collinear.
Pick two points from your textbook today, find the slope both ways, and check that you get the same answer.



