Sub topic 12
Foot of the perpendicular and reflections
This chapter assumes you can write a line as ax + by + c = 0, find a midpoint, and use the point-to-line distance formula from the earlier chapters. It shows how to find the point where a perpendicular from P meets a line (the foot) and the mirror image of P in that line (the reflection). CAT uses these in mirror, light-ray and shortest-path questions.
The idea in one picture
Let P be a point and L a line. Drop a perpendicular from P to L. The point where it meets L is the foot F. Continue the same distance past F and you reach the reflection P'.
This gives two facts that drive every method:
- F is the midpoint of PP'.
- PP' is perpendicular to L, and L is the perpendicular bisector of PP'.
So once you know the foot, the reflection follows: P' = 2F − P, taken coordinate by coordinate.
Method 1: the direct formula
Write the line as ax + by + c = 0. The vector (a, b) is perpendicular to the line. Starting at P(x₀, y₀), move along (a, b) by some amount t until you land on the line:
a(x₀ − at) + b(y₀ − bt) + c = 0
Solving gives t = (ax₀ + by₀ + c) / (a² + b²). Call this value d. Then:
- Foot: F = (x₀ − a·d, y₀ − b·d)
- Reflection: P' = (x₀ − 2a·d, y₀ − 2b·d)
The distance from P to the line is |d|·√(a² + b²), which matches the point-to-line distance formula.
Worked example
Find the foot and reflection of P(1, 2) in 3x + 4y − 10 = 0.
- d = (3·1 + 4·2 − 10) / (9 + 16) = 1/25 = 0.04.
- Foot = (1 − 3·0.04, 2 − 4·0.04) = (0.88, 1.84).
- Reflection = (1 − 0.24, 2 − 0.32) = (0.76, 1.68).
Check the foot on the line: 3(0.88) + 4(1.84) = 2.64 + 7.36 = 10. ✓
The same computation in code:
def foot(x0, y0, a, b, c):
# foot of the perpendicular from (x0, y0) to ax + by + c = 0
d = (a * x0 + b * y0 + c) / (a ** 2 + b ** 2)
return (x0 - a * d, y0 - b * d)
def reflect(x0, y0, a, b, c):
# reflection of (x0, y0) in ax + by + c = 0
d = (a * x0 + b * y0 + c) / (a ** 2 + b ** 2)
return (x0 - 2 * a * d, y0 - 2 * b * d)
print(tuple(round(v, 4) for v in foot(1, 2, 3, 4, -10)))
print(tuple(round(v, 4) for v in reflect(1, 2, 3, 4, -10)))
print(tuple(round(v, 4) for v in reflect(2, 3, 1, 1, -1)))The three lines print (0.88, 1.84), (0.76, 1.68) and (-2.0, -1.0).
Method 2: perpendicular line, then intersect
This method needs only slopes and simultaneous equations, so it is easy to do by hand when the numbers are small.
- Find the slope of L. The perpendicular has slope −1/m, or is vertical if L is horizontal.
- Write the line through P with that slope.
- Solve it together with L. The solution is the foot F.
- Compute P' = 2F − P.
Example: reflect P(2, 3) in x + y = 1. L has slope −1, so the perpendicular has slope 1 and equation y − 3 = x − 2, or y = x + 1. Substituting into x + y = 1 gives 2x + 1 = 1, so x = 0 and F = (0, 1). Then P' = (0 − 2, 2 − 3) = (−2, −1). This agrees with the code output above.
Shortcuts for special lines
These save the most time in a test. Learn them so you do not need the general formula.
| Mirror line | Image of (x, y) |
|---|---|
| x-axis (y = 0) | (x, −y) |
| y-axis (x = 0) | (−x, y) |
| y = x | (y, x) |
| y = −x | (−y, −x) |
| x = k | (2k − x, y) |
| y = k | (x, 2k − y) |
| y = x + k | (y − k, x + k) |
The last row follows from the general formula with a = 1, b = −1, c = k. Check it: the reflection of (0, 0) in y = x + 2 is (−2, 2). The midpoint is (−1, 1), which lies on y = x + 2. ✓
Reflecting a line, not just a point
A line is determined by two points, so you can reflect two points on it and rebuild the line. A faster route:
- If the mirror is a special line, apply the swap rule to the equation itself. Reflecting 2x + y = 4 in y = x swaps the variables and gives x + 2y = 4.
- For a general mirror, find where the line meets the mirror. That intersection point is its own reflection. Reflect one other point on the line, then join the two.
Reflection preserves distances and angles. A circle reflects into a circle of the same radius, so you only need to reflect its centre.
Shortest path and mirror problems
A frequent CAT setup is this: a point X on a line L must minimise AX + XB, or a light ray goes from A to a mirror and then to B.
If A and B are on the same side of L, reflect A to A'. For any X on L, AX = A'X, so AX + XB = A'X + XB. That sum is smallest when X lies on the straight segment A'B. The minimum value is the length A'B.
If A and B are on opposite sides, the straight segment AB already crosses L, and no reflection is needed.
Worked example
Minimise AX + XB for A(1, 2), B(7, 4), with X on the x-axis.
- Reflect A in the x-axis to get A'(1, −2).
- The line A'B has slope (4 + 2)/(7 − 1) = 1, so y + 2 = x − 1. It meets y = 0 at x = 3, so X = (3, 0).
- The minimum is A'B = √(6² + 6²) = 6√2.
Check: AX = √(4 + 4) = 2√2 and XB = √(16 + 16) = 4√2, and their sum is 6√2. ✓
The same reasoning gives the path of a light ray. The incoming ray and the reflected ray make equal angles with the mirror. The reflected ray therefore appears to come in a straight line from the image of the source.
Common errors
| Error | Fix |
|---|---|
| Forgetting to divide by a² + b² | d is a ratio, not the numerator alone |
| Wrong sign of c after moving terms | Rearrange to ax + by + c = 0 before substituting |
| Using x₀ + a·d | The foot moves toward the line, so subtract |
| Using one step for the reflection | The reflection moves twice as far: 2a·d and 2b·d |
| Reflecting A and B both in a shortest-path problem | Reflect only one of them |
| Using the reflection trick when A and B are on opposite sides | Join A and B directly |
A quick check you can always run
Take your answer P' and test two things. First, the midpoint of PP' must satisfy the line equation. Second, the slope of PP' times the slope of L must equal −1, unless one line is vertical or horizontal. These checks take about ten seconds and catch most sign errors.
Exercise
Find the foot of the perpendicular and the reflection of P(3, −1) in the line 2x − y + 1 = 0.
Show answer
Here a = 2, b = −1, c = 1. Then d = (2·3 − (−1) + 1) / (4 + 1) = 8/5. Foot = (3 − 2·8/5, −1 + 8/5) = (−1/5, 3/5). Reflection = (3 − 4·8/5, −1 + 2·8/5) = (−17/5, 11/5). Check: the midpoint of P and P' is (−1/5, 3/5), which satisfies 2x − y + 1 = −2/5 − 3/5 + 1 = 0.
Exercise
A ray of light travels from A(2, 3) to the y-axis and then to B(6, 1), and X is the point where it touches the y-axis. Find the minimum value of AX + XB and the coordinates of X.
Show answer
Reflect A in the y-axis to get A'(−2, 3). The minimum is A'B = √(8² + 2²) = √68 = 2√17. The line A'B has slope (1 − 3)/(6 + 2) = −1/4, so y − 3 = −(x + 2)/4. At x = 0, y = 3 − 1/2 = 5/2, so X = (0, 5/2).