作者:手机用户2602913361 | 来源:互联网 | 2018-03-22 22:28
[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