Hu-Bu-Gui (Different-Speed Minimum, sin-Angle Method)
To minimize (), take an angle , draw an auxiliary line through the fixed point, and convert the term into a perpendicular segment — the whole quantity collapses into "distance from a point to a line".
Hu-Bu-Gui — the standard model for a "weighted sum of distances" with a moving point on a line. Through a fixed point , draw an auxiliary line tilted by to swap for a perpendicular segment, then close out via "polyline point-to-line distance".
Universal form
Classical model
- Moving point : on a line
- Fixed point : anywhere on one side of
- Fixed point : on (or with a fixed projection direction onto )
- Key constraint: (if , rewrite as and draw the auxiliary line through the leg instead)
When to use
- Minimizing , where and is a moving point on some line
- The problem often mentions "two legs at different speeds", "sand vs. paved road", or "light through two media" — in essence, minimizing total time as
- The coefficient is the given "speed ratio" or "discount ratio" — the story-form version is called 胡不归 (Hu-Bu-Gui)
The core move
Set and draw an auxiliary line tilted by through the fixed point — this replaces with a perpendicular segment, and the whole sum collapses into "distance from to that auxiliary line".

Construction
Let be the line on which the moving point lies, a fixed point on one side of , and a fixed point on (or with a fixed projection direction onto ). We want with :
-
Fix the tilt angle: take (i.e. ).
-
Draw the auxiliary line: through , draw a line making angle with , on the same side as .

-
Trade for a perpendicular segment: for any , drop a perpendicular from to with foot . Then .

-
Fold into a polyline: (the distance from to the line , i.e. the perpendicular segment from to ).
-
Equality: holds when are collinear and — i.e. is the intersection of with the perpendicular from to . The minimum equals .
Why it works
The leg with coefficient cannot be handled by the usual reflection trick (General Drinking Horse (axial-symmetry shortest path) only works for ). But multiplying "distance from to " by gives exactly "distance from to a line that passes through at tilt " — this spreads the weight into the geometry. After the swap, what remains is the everyday fact that a polyline is at least as long as a straight segment (distance from a point to a line).
Worked examples
- In with , moves on ; minimize (take , so — this happens to coincide with , and the auxiliary line is the line containing ).
- Sand-and-road problem: from , with sand speed and road speed (), the road is the line and the target lies on the road. Minimizing total time is equivalent to minimizing .
Variants / generalizations
-
The case : has no solution. Switch to and run the same playbook (the coefficient now applies to the leg).
-
Three weighted legs (): a single auxiliary line is not enough — switch to Weighted Fermat Point (rotation + scaling lemma) (rotation + scaling).
-
Physical meaning: is exactly Snell's law of refraction; Hu-Bu-Gui is, in essence, Fermat's principle at a two-medium boundary turned into an construction.
