Fix turn-around issues and make algorithms more able to cope with zero-distance calculations

I cleaned up some algorithms.

Now the library should behave better wrt zooming out (still not perfect though), and it should also stop drawing useless circles (see https://github.com/tyrasd/overpass-ide/pull/117)

The overall behaviour shouldn't be altered.