Let $f(x)=\sin x$, and $g(x)=\sin x + 1$. Consider a set $S=\{(x,y) f(x)\leq y \leq g(x), x\in [0,2\pi]\}$. This set $S$ can be considered as "Raceway" My question is finding the shortest path in $S$ such that initial point lies in $\{0\}\times [0,1]$, and the terminal point lies in $\{2\pi\}\times [0,1]$.

Just an illustration of the question:


