You are here: Re: Issues working with complex math « All PHP « IT news, forums, messages
Re: Issues working with complex math

Posted by Mitul on 09/28/48 11:41

Hello friend,

I hope that following function will helpful to your. This function will
use to calculate circular distance

function Calculate_distance($lat1, $lon1, $lat2, $lon2) {
$theta = $lon1 - $lon2."<br>";
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +
cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);

return $miles = round($dist * 60 * 1.1515);

}

With Regards,
Mitul Patel
mitul [at] siliconinfo [dot] com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация