View Single Post
Old 12-07-2008, 10:01 AM  
rowan
Too lazy to set a custom title
 
Join Date: Mar 2002
Location: Australia
Posts: 17,393
Quote:
Originally Posted by borked View Post
Surrounding areas are calculated from latitude/longitude parameters of the visitor IP - complicated maths cos the world isn't flat ;)
$theta = $lon1 - $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$miles = $dist * 60 * 1.1515;
$unit = strtoupper($unit);

Surrounding areas can be turned off in that add image:

Nearby ON: and with Nearby OFF:
Yep, I know about matching up nearby localities, do it with my photo website... I'm just curious where you got the loc db from?
rowan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote