## Tuesday, December 20, 2011

### Saving curved distance

Today I was walking towards a friend's place, and I was really exhausted because the walk there was quite long. I happened to reach a curved road just before his place. The plot of the road looked something like this:

Sorry for all the extra notations. I will explain.

I happened to be at position A, and needed to get to position B, which was his house. As I said earlier, I was really tired and wanted to walk the least distance to get to his place. I was also feeling creative. There happened to be pedestrian crossings at AC and BD too.

I could possibly walk from A to B. Alternatively, I could cross from A to C, walk to D, and then cross from D to B. I was thinking, which path would be shorter, AB or ACDB? If you assume the paths are perfectly circular, you can come up with some interesting results!

Here's the mathy part of it.

\large \begin{align*} &(1) \\\\ &s_{AB}=\frac{\pi}{180}\cdot \theta \cdot r_2 \\\\ &s_{ACDB}=\frac{\pi}{180}\cdot \theta \cdot r_1+ 2(r_2-r_1) \\\\ &=\frac{\pi}{180}\cdot \theta \cdot r_1+ 2(\Delta r) \\\\ &\textup{Where}\: \, \theta \:\, \textup{is in degrees} \end{align*}

\large \begin{align*} &(2) \\\\ s_{ACDB}-s_{AB}\! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \\\\ &=\frac{\pi}{180}\cdot \theta \cdot r_1+ 2(\Delta r)-\frac{\pi}{180}\cdot \theta \cdot r_2 \\\\ &=2(\Delta r)-\frac{\pi}{180} \cdot \theta \cdot (\Delta r) \\\\ &=\Delta r\: (2-\frac{\pi}{180} \cdot \theta) \end{align*}

To find the condition for which ACDB is shorter than AB:

\large \begin{align*} &(3) \\\\ s_{ACDB}-s_{AB}< 0\! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \! \\\\ &\therefore \Delta r\: (2-\frac{\pi}{180} \cdot \theta)< 0 \\\\ &\frac{\pi}{180} \cdot \theta-2> 0 \\\\ &\theta> \frac{360}{\pi} \\\\ &\theta> 115^{\circ}\, \textup{approximately} \end{align*}

What this result shows is that if my friend's place was located at an angle of rotation of more than 115 degrees from A, it would be more economical (distance wise) to travel via ACDB. If you are faced with a similar problem, check if the rotational distance covers about a third of an entire circle, or about 1.5 times the rotation of a quarter of a circle. If it does, a path similar to ACDB should be taken.

This idea also holds for any value of r1 and r2, as shown by the proof above. But of course, if r1 and r2 are small, then the distance saved would be quite small too. To some, this distance saved might be so small that it wouldn't matter which path is taken. But for larger scale problems, where r1 and r2 are huge, taking the path ACDB might just save you a lot of distance, provided that the angle of rotation is greater than 115 degrees and that the paths are perfectly or reasonably circular.

As to what really happened, I took the longer path and, being the nerd I am, drained even more of my energy pouring over this minute but interesting problem.

LaTeX codes source: http://www.codecogs.com/latex/eqneditor.php