Slope and the angle between lines · Mathematics Class… | StemPy Lab
Course 6.1·Lesson 1 of 3
Slope and the angle between lines
The slope of a line measures how steeply it climbs: the change in y divided by the change in x between any two of its points. It equals tanθ
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the slope of a line from two of its points;
link the slope to the angle of inclination, with m=tanθ;
see why a vertical line has no slope;
find the angle between two lines from their slopes.
How steep is a line?
A ramp rises 1m for every 4m of ground it crosses. Its steepness is 41. The same idea measures any straight line on the coordinate plane.
Take two points P(x1,y1) and Q(x2,y2) on a line, with x1=x2. Going from P to Q the line rises by y2−y1 while it runs across by x2−x1.
The slope of the line is m=x2−x1y2−y1=runrise.
A line rises from lower left to upper right across the coordinate axes. Two blue dots on it are labelled P with coordinates x one, y one, and Q with coordinates x two, y two. A green horizontal segment from P is labelled run equals x two minus x one. A red vertical segment up to Q is labelled rise equals y two minus y one. An orange arc at the point where the line crosses the x-axis is labelled theta, the angle of inclination. A line of text says slope m equals rise divided by run equals tan theta.
The slope is the same for any two points of the line. Triangles built on the line in this way are all similar, so their sides keep the same ratio. If you swap P and Q, both the rise and the run change sign, and the slope stays the same.
A line that climbs to the right has a positive slope.
A line that falls to the right has a negative slope.
A horizontal line has rise 0, so its slope is 0.
The angle of inclination
The angle of inclinationθ of a line is the angle from the positive x-axis, turning anticlockwise, to the line. It lies in the range 0∘≤θ<180∘.
In the right triangle of the figure, tanθ=runrise. So
m=tanθ.
A few values are worth knowing. A line at 45∘ has m=1. A line at 60∘ has m=3. A line at 30∘ has m=31. A line at 135∘ has m=−1, because tan135∘=−tan45∘.
An acute angle gives a positive slope, and an obtuse angle gives a negative slope. To go back from a negative slope, find the acute angle for ∣m∣ and subtract it from 180∘.
A vertical line has θ=90∘. Its run is 0, so the slope would need a division by zero, and tan90∘ is not defined. We say a vertical line has no slope. Its equation is of the form x=a.
The angle between two lines
Two lines cross at a point and make two angles, θ and 180∘−θ. Let the lines have slopes m1 and m2 and inclinations θ1 and θ2, with θ2>θ1.
Two lines leave the origin. The blue line, L one, has slope m one and is the flatter one. The red line, L two, has slope m two and is steeper. A blue arc from the x-axis to the blue line is labelled theta one. A red arc from the x-axis to the red line is labelled theta two. An orange arc between the two lines is labelled theta. The text says theta equals theta two minus theta one, and tan theta equals m two minus m one, divided by one plus m one times m two.
The angle between the lines is θ=θ2−θ1. Use the tangent of a difference:
The result is positive for the acute angle and negative for the obtuse one. To ask only for the acute angle, take the absolute value:
tanθ=1+m1m2m2−m1.
Two special cases come out of the formula. If m1=m2, then tanθ=0 and the lines are parallel. If 1+m1m2=0, the denominator is 0 and θ=90∘, so the lines are perpendicular. The next lesson uses both.
A worked example
A line through two points. Find the slope and the angle of inclination of the line through A(1,5) and B(4,−1).
The slope.m=4−1−1−5=3−6=−2.
The acute angle.tanα=2 gives α=63.4∘.
The inclination. The slope is negative, so θ=180∘−63.4∘=116.6∘.
The angle between two lines. Find the acute angle between lines of slopes 2 and 5.
The formula.tanθ=1+2×55−2=113.
The angle.θ=15.3∘.
Practise with new numbers
Try it in Python
The program finds the slope and the angle of inclination of a line from two points, and the angle between two slopes. It returns None for a vertical line.
Common mistakes
Dividing the run by the rise. The slope is x2−x1y2−y1, with the y values on top.
Mixing the order. Subtract the points in the same order on the top and the bottom.
Saying a vertical line has slope 0. A horizontal line has slope 0. A vertical line has no slope.
Using θ=arctanm for a negative slope. That gives a negative angle. Add 180∘ for the angle of inclination.
Forgetting the absolute value. Without it, the formula may give the obtuse angle.
Remember these
m=x2−x1y2−y1=tanθ, where θ is the angle of inclination.
A positive slope means an acute angle, a negative slope an obtuse angle, and a vertical line has no slope.
The acute angle between two lines has tanθ=1+m1m2m2−m1.
The obtuse angle between them is 180∘−θ.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the slope of the line through (−1,6) and (3,−2).
What angle does a line of slope 3 make with the positive x-axis?
A line has slope −1. Find its angle of inclination.
Why does a vertical line have no slope?
Find the acute angle between the x-axis and the line of slope 1.
Enroll free in Slope and Equations of Straight Lines
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.