From: Dan Diebolt Date: 2005-12-14T02:59:42+09:00 Subject: Re: US Zipcode API for Ruby? --0-967764346-1134496775=:71882 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit There is a 40,000+ zip code database in CivicSpace labs that has lat and long by zip code: http://civicspacelabs.org/home/developers/download http://civicspacelabs.org/releases/zipcodes/zipcodes-csv-10-Aug-2004.zip Distance between two points (lat, long) is calculated using the Haversine formula: dlon = lon2 - lon1 dlat = lat2 - lat1 a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2 c = 2 * atan2(sqrt(a), sqrt(1-a)) d = R * c See the following link or google for more: http://mathforum.org/library/drmath/view/51879.html --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping --0-967764346-1134496775=:71882--