Sub topic 11
The angle between two lines
This chapter assumes you can find the slope of a line from two points, convert between forms of a line's equation, and recall the parallel and perpendicular slope conditions from earlier chapters. You also need the tangent of an angle and the identity for tan(A − B).
Why this matters for CAT
Angle questions in coordinate geometry are usually short once you know the slope formula. Typical forms are "find the angle between these lines", "find the lines through a point that make 45° with a given line", and "find an interior angle of a triangle given its vertices". They also appear inside other problems, for example when a bisector or a reflection has to be set up.
The formula and where it comes from
Every non-vertical line has an inclination: the angle α, measured from the positive x-axis, that the line makes. Its slope is m = tan α. Take two lines with inclinations α₁ and α₂ and slopes m₁ and m₂. One angle between them is α₂ − α₁, so
tan(α₂ − α₁) = (tan α₂ − tan α₁) / (1 + tan α₁ tan α₂) = (m₂ − m₁) / (1 + m₁m₂).
Two lines that cross form two pairs of equal angles, one acute (or right) and one obtuse, and the two values add to 180°. The usual convention is to ask for the acute angle θ, so take the absolute value:
tan θ = | (m₁ − m₂) / (1 + m₁m₂) |
Special cases
| Situation | Condition | Result |
|---|---|---|
| Parallel lines | m₁ = m₂ | numerator is 0, so θ = 0° |
| Perpendicular lines | m₁m₂ = −1 | denominator is 0, so tan θ is undefined and θ = 90° |
| One line vertical | slope does not exist | use the shortcut below |
The perpendicular case is the reason the condition m₁m₂ = −1 exists. Do not divide by zero. Check the denominator first and say "90°" when it vanishes.
For a vertical line, the inclination is 90°. If the other line has slope m, its inclination α satisfies tan α = m, so the acute angle between the two lines is 90° − α (for α between 0° and 90°). This gives tan θ = 1/|m|. If both lines are vertical, they are parallel.
Using the general form
If the lines are written as a₁x + b₁y + c₁ = 0 and a₂x + b₂y + c₂ = 0, the slopes are −a₁/b₁ and −a₂/b₂. Substituting and simplifying gives
tan θ = | (a₁b₂ − a₂b₁) / (a₁a₂ + b₁b₂) |
This version never divides by b, so vertical lines (b = 0) need no special treatment. The numerator is zero for parallel lines. The denominator is zero for perpendicular lines.
Worked example 1: two lines
Find the angle between y = 2x + 1 and 3y = x − 9.
- The slopes are m₁ = 2 and m₂ = 1/3.
- m₁ − m₂ = 2 − 1/3 = 5/3.
- 1 + m₁m₂ = 1 + 2/3 = 5/3.
- tan θ = (5/3) / (5/3) = 1, so θ = 45°.
Worked example 2: a triangle's interior angles
Take A(0, 0), B(4, 0), C(1, 3).
- Side AB has slope 0. Side AC has slope 3. At A, tan = |(3 − 0)/(1 + 0)| = 3, so A = arctan 3 ≈ 71.57°.
- Side BA has slope 0. Side BC has slope (3 − 0)/(1 − 4) = −1. At B, tan = |(−1 − 0)/(1 + 0)| = 1, so B = 45°.
- Sides CA and CB have slopes 3 and −1. Without the absolute value, (3 − (−1))/(1 + 3(−1)) = 4/(−2) = −2. The acute angle between the lines has tan = 2, which is about 63.43°.
The three angles are 71.57° + 45° + 63.43° = 180°, so the triangle is consistent.
Lines at a given angle to a known line
CAT often reverses the problem: given a line of slope m, find the slope m′ of a line that makes angle θ with it. Set |(m′ − m)/(1 + mm′)| = tan θ and solve both signs. You get two answers, one on each side of the given line.
For θ = 45°, tan θ = 1, and the two solutions are:
- m′ = (1 + m) / (1 − m)
- m′ = (m − 1) / (1 + m)
These two slopes are negative reciprocals of each other, because the two lines are perpendicular. That is a useful check.
Worked example: find the lines through (1, 1) that make 45° with a line of slope 2.
- Using the formulas, m′ = (1 + 2)/(1 − 2) = −3 or m′ = (2 − 1)/(1 + 2) = 1/3.
- For m′ = −3: y − 1 = −3(x − 1), which is 3x + y − 4 = 0.
- For m′ = 1/3: y − 1 = (x − 1)/3, which is x − 3y + 2 = 0.
For 30° or 60°, use tan 30° = 1/√3 and tan 60° = √3 in the same equation.
Angle bisectors
The bisector of the angle between two lines is the set of points equidistant from both. Using the point-to-line distance from the earlier chapter:
(a₁x + b₁y + c₁) / √(a₁² + b₁²) = ± (a₂x + b₂y + c₂) / √(a₂² + b₂²)
The two signs give two perpendicular bisectors, one for the acute angle and one for the obtuse angle. For example, the bisectors of the axes x = 0 and y = 0 are x = y and x = −y. To tell which bisector cuts the acute angle, test which one makes a smaller angle with either line, using the formula from this chapter.
Checking the formula in code
This function uses the general-form version. It takes the absolute values of the cross term and the dot term, and atan2 handles the 90° case without any division.
import math
def angle_between(a1, b1, a2, b2):
# acute angle in degrees between a1*x + b1*y + c1 = 0 and a2*x + b2*y + c2 = 0
cross = a1 * b2 - a2 * b1
dot = a1 * a2 + b1 * b2
return round(math.degrees(math.atan2(abs(cross), abs(dot))), 2)
print(angle_between(2, -1, 1, -3)) # y = 2x + 1 and x - 3y - 9 = 0
print(angle_between(1, 0, 1, -1)) # x = 0 and y = x
print(angle_between(1, 1, 2, 2)) # parallel lines
print(angle_between(1, 0, 0, 1)) # the two axesThe output is 45.0, 45.0, 0.0 and 90.0. The first line reproduces worked example 1. The second shows a vertical line with no special handling.
Choosing a method
Common errors
- Dropping the absolute value and reporting an obtuse angle when the question asks for the acute one.
- Writing 1 − m₁m₂ in the denominator. The sign is plus.
- Using the formula when a line is vertical. Use the shortcut or the general-form version.
- Mixing up the angle between lines with a triangle's interior angle. Check with the angle sum.
- Giving only one line when a question asks for lines making a given angle. There are two, one on each side.
- Reading the slope from a general-form equation as a/b instead of −a/b.
Practice
Exercise
Find the acute angle between the lines 3x − y + 2 = 0 and 2x + y − 5 = 0.
Show answer
The slopes are m₁ = 3 and m₂ = −2. Then tan θ = |(3 − (−2)) / (1 + 3·(−2))| = |5 / (−5)| = 1, so θ = 45°. As a check with the general form, |(3·1 − 2·(−1)) / (3·2 + (−1)·1)| = |5/5| = 1.
Exercise
Find the equations of the lines through (1, 1) that make an angle of 45° with the line y = 2x + 3.
Show answer
Solve |(m′ − 2) / (1 + 2m′)| = 1. Taking +1 gives m′ − 2 = 1 + 2m′, so m′ = −3. Taking −1 gives m′ − 2 = −1 − 2m′, so m′ = 1/3. The lines are y − 1 = −3(x − 1), which is 3x + y − 4 = 0, and y − 1 = (x − 1)/3, which is x − 3y + 2 = 0.
Exercise
A line through the origin makes an angle of 60° with the vertical line x = 5. Find its possible equations.
Show answer
The vertical line has inclination 90°. A line at 60° to it has inclination 30° or 150°, so its slope is tan 30° = 1/√3 or tan 150° = −1/√3. The equations are y = x/√3 and y = −x/√3, that is x − √3y = 0 and x + √3y = 0.