title: Haversine vs Equirectangular approximation
body: <p>So, I need to calculate distances betweeen two points (lat-lon pairs). I've read about Haversine formula and Equirectangular approximation in <a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="nofollow">Movable Type Scripts</a>.</p>
  
  <p>Since I only want to calculate short distances (less than 4 KM), is the Equirectangular formula a good approximation?</p>
  
  <p>Also, I've read about lat-lon storage in MySQL databases <a href="https://developers.google.com/maps/articles/phpsqlsearch_v3?csw=1" rel="nofollow">in Google Developers documentation</a> and they implement the Haversine formula like this:</p>
  
  <pre><code>SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance &lt; 25 ORDER BY distance LIMIT 0 , 20;
  </code></pre>
  
  <p>My last question is, is there any big performance differences between filtering the points in the sql query (as in the example) and filtering them by code?.</p>