Some numbers can be explained easily
-
MeanRadiusEarthInKm = 6371 (according to IUGG)
-
DegToRadDivisor = 180/PI = 57.2958
And again the zoom level doubles the size with each step, i.e. increase the zoomlevel by one halfs the size on the screen.
zoom = 8 - log(factor * dist) / log(2) = 8 - log_2(factor * dist)
=> dist = 2^(8-zoom) / factor
From the numbers we find that zoom level eight corresponds to a distance of 276.89km.