0 karma · joined Apr 30, 2008 (18y ago) · 12 submissions
comment 18y ago · link · parent
comment 18y ago · link · parent
Just a note: comparing every zip code and its distance and recording the distance to a DB would create upwards of 12 million records. This might be the breaking point for some.... I was thinking about doing it myself. Once I worked out the numbers I backed away.
If you know the origin and destination long and lat this works well to calc distance. $dist = sin(deg2rad($this->lat1)) * sin(deg2rad($this->lat2)) + cos(deg2rad($this->lat1)) * cos(deg2rad($this->lat2)) * cos(deg2rad($theta));
comment 18y ago · link · parent