Still not solved. Tried to approach by calculating properties of elliptical arcs, but there are so many edge cases...
A simple map viewer.