Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating Distance Between 2 Zip Codes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00422168
Message ID:
00422259
Vues:
28
Where do you look up latitude and longitude based on zip code? Cause a zip code could be a huge land area, or just a single campus...

>The the formula for the approximate solution is:
>
>One degress of latitude is 69.1mi. One degree on longitude is 69.1mi at the equator and reduces by the cosine of the latitude. Foxpro's Trig functions require radians, so DTOR().
>
>Latdist in mi=69.1 * (lat2-lat1)
>Longdist in mi=69.1*(lg2-lg1)*cos(dtor(lat1))
>total dist=(latdist^2 +longdist^2)^.5
>
>The exact distance formula is:
>
>Distance=3959*acos( sin(dtor(lat1))*sin(dtor(Lat2))+cos(dtor(lat1))*cos(dtor(Lat2))*cos(dtor(Long2)-dtor(long1)))
>
>(from Mailer's +4 users manual)
>
>HTH
Jason Bradley Nance
jbnance@tresgeek.net

Got root?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform