You're absolutely right - in my experience the pythagorean theorem has less than ~50 meters difference from the Haversine formula for distances less than 20 miles or so. In the actual code I use a simple heuristic to decide when to use which calculation.<p>Like I mentioned in the post, the distance function presented is a bit of a simplification I invented for pedagogical purposes (my goal was to examine languages, not geometry).