龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

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

时间:2014-07-22 14:49来源: 作者: 点击:
分享到:
计算百度地图两点间的距离
计算百度地图两点间的距离
//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
精彩图集

赞助商链接