A recent example, I was walking in a tunnel (
view) that goes under the railway. The tunnel curves slightly towards the left. Normally you'd keep an equal distance to the side walls of the tunnel, meaning that your route forms a curved line in relation to the map.
But obviously, you want to aim towards the closest point in the exit that is in line with your destination path, to minimize needless energy spent.
So to do that, you must approach the left wall in the first half of the tunnel, and again approach the center at the second half of the tunnel.
However, the first half of the tunnel is a downhill, and the second half of the tunnel is almost flat. What works in 2D does not necessarily work in 3D. You must consider that the slightly diagonal surface (downhill) of the first part of the tunnel is longer than it appears, because of the hill. So do you need to converge more, or less, to spend least energy? Keep in mind that in a downhill, the gravity assists you so less energy is consumed even if you walk a longer route.
But oh no, in front of you, there are two persons who are directly in line with your "optimal" path, and they're walking slower than you are. So what do you do? Do you pass them by the left side, or by the right side? Furthermore, when is the optimal moment to pass them? You can control the moment by speeding up your pace a bit and slowing down it after passing, so you maintain the same average energy consumption.
If you're going to lengthen your route to pass them, you'd probably pass them in the downhill, because it costs less energy to speed up your pace in a downhill than it does in the flat part.
Yes, I was really thinking all of that in the moment.