Accuracy of distance between latitude longitude pairs
<p>I need to sort a set of addresses based on the distance from a specifc point. I have latitude and longitude for all these addressses,I am finding the distance with the below Java code.</p>

<pre><code>Double theDistance = (Math.sin(Math.toRadians(latA)) *
                Math.sin(Math.toRadians(latB)) +
                Math.cos(Math.toRadians(latA)) *
                Math.cos(Math.toRadians(latB)) *
                Math.cos(Math.toRadians(longA - longB)));       
            theDistance = (Math.toDegrees(Math.acos(theDistance))) * 69.09;\
</code></pre>

<p>But when I compare the results(I mean the sort order (not the actual distance)) with the actual Google map, they don't match. Is it the case always? or Am I not doing it correct?</p>

<p>We found that for Google/Yahoo map web service has some restrictions as a result we can't use in our application. </p>

<p>What is the best way to find the distance between two addresses given that you have the latitude and longitude. </p>
