[thelist] Zip Code Distance From

Matt Warden mwarden at gmail.com
Wed Mar 28 12:33:24 CDT 2007


On 3/28/07, Jason Handby <jason.handby at corestar.co.uk> wrote:
> Using pythagoras will be quicker than sine and cosine :-)

It also won't get you the right answer.

You need to use a formula to calculate a triangle on a globe rather
than on a plane. If you want to see a bunch of scary formulas, see:
http://en.wikipedia.org/wiki/Law_of_cosines_%28spherical%29

Otherwise, search for any number of algorithms on the net. Personally,
I would approach this by grabbing a PHP or Perl algorithm and then
translating that into VB/C#/whatever.

-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list