Posted By

elightbo on 11/03/06

Who likes this?

2 people have marked this snippet as a favorite

ASP Calculate distance between two points given latitude / longitude

/ Published in: ASP

```':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::':::                                                                         :::':::  This routine calculates the distance between two points (given the     :::':::  latitude/longitude of those points). It is being used to calculate     :::':::  the distance between two ZIP Codes or Postal Codes using our           :::':::  ZIPCodeWorld(TM) and PostalCodeWorld(TM) products.                     :::':::                                                                         :::':::  Definitions:                                                           :::':::    South latitudes are negative, east longitudes are positive           :::':::                                                                         :::':::  Passed to function:                                                    :::':::    lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees)  :::':::    lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees)  :::':::    unit = the unit you desire for results                               :::':::           where: 'M' is statute miles                                   :::':::                  'K' is kilometers (default)                            :::':::                  'N' is nautical miles                                  :::':::                                                                         :::':::  United States ZIP Code/ Canadian Postal Code databases with latitude   :::':::  & longitude are available at http://www.zipcodeworld.com               :::':::                                                                         :::':::  For enquiries, please contact [email protected]