The problem: one stop on a straight line
A straight road is a line. Point A and point B are on the same side of it. You start at A, touch the road at some point P, and then go to B. We want the shortest total walk, that is, the smallest value of AP + PB.
If A and B were on opposite sides of the road, it would be easy: walk straight from A to B and you cross the road on the way. The hard case is when both are on the same side. Then a straight walk from A to B never touches the road.
The mirror trick: reflect B
Think of the road as a mirror. Put B in front of the mirror and look at its image. The image is the point B′. It is the same distance behind the road as B is in front, and the line BB′ meets the road at a right angle.
Now take any point P on the road. The mirror makes triangle P-B-foot and triangle P-B′-foot exactly the same, so PB = PB′. This is the key fact. It means
AP + PB = AP + PB′
The mirror has turned a bent path into a path from A to B′ that goes through P. Now the road is not in our way, because B′ is on the other side. The shortest way from A to B′ is the straight line AB′. That line must cross the road, and the crossing point is the best P.
Steps to solve any such problem
- Check that A and B are on the same side of the line. (If not, just join A and B.)
- Reflect B in the line to get B′. Reflect it straight across, along a line at 90° to the road.
- Join A to B′ with a straight line.
- Mark P where AB′ meets the road. This P is the best stop.
- The shortest length is AB′. Find it with the Pythagoras theorem or the distance formula.
You can reflect A instead of B. The answer is the same.
Why no other point can do better
Take any other point Q on the road. Then AQ + QB = AQ + QB′. In the triangle A-Q-B′, two sides together are longer than the third side, so AQ + QB′ is more than AB′. So every other stop gives a longer walk than the stop on the straight line. Only when Q lies on AB′ do the two become equal.
There is one more thing to see. At the best P, the road makes equal angles with PA and PB. This is how light bounces off a mirror, and it is why light is said to choose the shortest path.
Try it: string and paper
On paper: Draw a long line for the road. Mark A and B on one side. Fold the paper along the road and prick through B with a pin to mark B′ on the other side. Open the paper, join A to B′ with a ruler, and mark P. Now pick a different point Q on the road and measure AQ + QB with a thread. Check that it is longer than the path through P.
In the 3D above: predict where the best P will be, then slide P and check the green colour.
Key formulas and definitions
- Best stop P: the point where line AB′ meets the road (B′ is B reflected in the road)
- PB = PB′ for every P on the road
- Shortest total = AB′ = √(d² + (a + b)²), where a and b are the distances of A and B from the road and d is the gap between their feet
- Distance from the foot of A to P = d × a ÷ (a + b)
Worked examples
1. A is 3 units from a straight road and B is 2 units from it. Their feet on the road are 9 units apart. Find the shortest path from A to the road to B.
Reflect B to B′, which is 2 units on the other side. Then A and B′ are a + b = 3 + 2 = 5 units apart across the road and 9 units apart along it. AB′ = √(9² + 5²) = √106 ≈ 10.3 units. P is 9 × 3 ÷ 5 = 5.4 units from the foot of A.
2. A and B are both 4 m from a road and their feet are 6 m apart. Where is the best stop and how long is the shortest walk?
B′ is 4 m on the other side, so A and B′ are 8 m apart across the road and 6 m along it. AB′ = √(6² + 8²) = 10 m. P is 6 × 4 ÷ 8 = 3 m from each foot, exactly in the middle.
3. On a grid the road is the x-axis. A = (0, 2) and B = (6, 4). Find the best point P on the road.
Reflect B in the x-axis: B′ = (6, −4). The line from A (0, 2) to B′ (6, −4) goes down 6 while going right 6, so its slope is −1. It meets y = 0 when x = 2. So P = (2, 0). The shortest length is AB′ = √(6² + 6²) = 6√2 ≈ 8.49.
4. A tent is 120 m from a straight river bank and a hut is 180 m from it, on the same side. The two feet are 400 m apart. A girl goes from the tent to the river to fill a pot, then to the hut. What is the shortest distance she must walk?
Reflect the hut to the other bank: it is 180 m behind the river. Across the river the tent and the image are 120 + 180 = 300 m apart, and along it 400 m. Distance = √(400² + 300²) = 500 m. She fills the pot 400 × 120 ÷ 300 = 160 m from the foot of the tent.
5. In Example 2, suppose the person stops 1 m from the foot of A instead of 3 m. How much longer is the walk?
AP = √(1² + 4²) = √17 ≈ 4.12 m. PB: P is 5 m from the foot of B, so PB = √(5² + 4²) = √41 ≈ 6.40 m. Total ≈ 10.52 m. That is about 0.52 m more than the shortest 10 m.
6. A mirror lies along the x-axis. A light ray goes from A (1, 3) to the mirror and then to B (7, 1). Where does it hit the mirror?
Reflect B to B′ = (7, −1). The line from A (1, 3) to B′ (7, −1) goes right 6 and down 4. It reaches y = 0 after going down 3, which is 3 ÷ 4 of the way, so x = 1 + 6 × 3/4 = 5.5. The ray hits the mirror at (5.5, 0). The shortest length is √(6² + 4²) = √52 ≈ 7.21.
Common mistakes
- Reflecting B when A and B are on opposite sides. Then there is nothing to reflect: just join A and B.
- Reflecting along a slanted line. The reflection must go straight across, at 90° to the road.
- Taking the nearest point of the road to A as the best stop. The best P depends on both A and B.
- Measuring the final answer as A to B. The shortest path is A to B′, which is longer than A to B and equals AP + PB.