DennisOSRM/Project-OSRM — pull request #382 by emiltin (2012-08-23 17:26:19+00:00)
Title: simplified distance formula. more precise values for distance testing

i was working on calculating a more precise scaling constant for use in the distance tests, when i discovered that the distance formula can be greatly simplified.

the formula provides the same mathematical result. but should be more numerically stable and less prone to rounding errors, since it much simpler, and doesn't involve trigonometric functions.

the original formula boils down to pythogoras' good old formula c=sqrt(a*a+b+b). this suprises me, since the earth is of course not flat. also the original formula did involve some trig stuff, so i'm wondering what's going on.

this pull request also provides an accurate distance scaling in the cucumber tests. test on 10000km scale now return accurate results (try cucumber features/distance.feature:262)