Home >php教程 >PHP源码 >百度地图两点间的距离计算php版

百度地图两点间的距离计算php版

PHP中文网
PHP中文网Original
2016-05-25 17:03:501643browse

[PHP]代码  

//Business_Latitude_new,Business_Longitude_new是当前坐标
//$latitude,$longitude是目标坐标
distance=6371.012 *
       acos(cos(acos(-1) / 180 * Business_Latitude_new) *
            cos(acos(-1) / 180 * $latitude) *
            cos(acos(-1) / 180 * Business_Longitude_new - acos(-1) / 180 * $longitude) +
            sin(acos(-1) / 180 * Business_Latitude_new) *
            sin(acos(-1) / 180 * $latitude))*1

                   

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn