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

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

PHP中文网
Release: 2016-05-25 17:03:50
Original
1642 people have browsed it

[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
Copy after login

                   

                   

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template