Sub topic 6
Parallel and Perpendicular Lines
Prerequisites and the key idea
Assume you can simplify fractions, solve linear equations, and use the Pythagorean theorem. You should also know that the slope of a line measures its vertical change divided by its horizontal change.
For two points \((x1,y1)\) and \((x2,y2)\), the slope is
\[ m=\frac{y2-y1}{x2-x1}. \]
A horizontal line has slope \(0\). A vertical line has undefined slope because its horizontal change is \(0\).
Two lines are parallel when they have the same direction and never meet. Two lines are perpendicular when they meet at a right angle.
Testing parallel lines
If two nonvertical lines have slopes \(m1\) and \(m2\), they are parallel exactly when
\[ m1=m2. \]
For example, consider
\[ y=3x+4 \quad\text{and}\quad y=3x-7. \]
Both slopes are \(3\), so the lines are parallel. Their different intercepts show that they are distinct lines.
For lines written in general form,
\[ A1x+B1y+C1=0 \quad\text{and}\quad A2x+B2y+C2=0, \]
the slopes are \(-A1/B1\) and \(-A2/B2\), when the \(B\)-values are nonzero. Thus, parallel lines satisfy
\[ A1B2=A2B1. \]
This form also handles vertical lines more safely than calculating slopes directly.
Testing perpendicular lines
For two nonvertical lines, perpendicular slopes satisfy
\[ m1m2=-1. \]
Therefore, the perpendicular slope to \(m\) is its negative reciprocal. The negative reciprocal of \(2/3\) is \(-3/2\).
For example,
\[ y=\frac{2}{3}x+1 \quad\text{and}\quad y=-\frac{3}{2}x+5 \]
are perpendicular because
\[ \frac{2}{3}\left(-\frac{3}{2}\right)=-1. \]
A horizontal line is perpendicular to a vertical line. Do not try to use the product rule with an undefined vertical slope.
For general-form lines, the perpendicular condition is
\[ A1A2+B1B2=0. \]
This is the dot-product test. The coefficient pairs \((A1,B1)\) and \((A2,B2)\) act as normal vectors to the lines.
| Relationship | Slope condition | General-form condition |
|---|---|---|
| Parallel | \(m_1=m_2\) | \(A_1B_2=A_2B_1\) |
| Perpendicular | \(m_1m_2=-1\) | \(A_1A_2+B_1B_2=0\) |
A reliable CAT method
When a question gives two points on each line:
- Calculate each slope.
- Check whether the slopes are equal.
- If not, multiply them and check whether the product is \(-1\).
- Treat horizontal and vertical lines separately.
- Use the shortest valid test rather than finding unnecessary intercepts.
def slope(p, q):
dx = q[0] - p[0]
dy = q[1] - p[1]
if dx == 0:
return None # vertical line
return dy / dx
print(slope((1, 2), (4, 8))) # 2.0
print(slope((0, 5), (3, 5))) # 0.0Exercise
Are the lines through \((1,4),(5,12)\) and \((-2,7),(2,5)\) parallel or perpendicular?
Show answer
Their slopes are \(2\) and \(-1/2\). Their product is \(-1\), so the lines are perpendicular.