Home Archives Pseudo FAQ
2007.07.25

The distance between two points...

const EARTH_RADIUS_MILES = 3963;
$x = (sin($latitude1) * sin($latitude2)) + (cos($latitude1) * cos($latitude2) * cos($longitude2 - $longitude1));
$distance = EARTH_RADIUS_MILES * (-1 * atan($x / sqrt(1 - $x * $x)) + PI / 2);

comments(3) | permalink

Posted by at 2:13 p.m.

Threeve

Posted by on 2007.07.26 at 5:11 p.m.

My brain hurts.

Posted by on 2007.08.05 at 9:58 a.m.

Oh, it's not that bad. ;)

Posted by on 2007.08.07 at 2:35 a.m.

Post a Comment