计算球面两点距离 python
2016-10-24 13:02
633 查看
代码如下
@requires_authorization #!/usr/bin/env python #-*-encoding:utf-8 -*- import math def cal_dis_meters(radius,latitude1, longitude1,latitude2, longitude2): radLat1 = (math.pi/180)*latitude1 radLat2 = (math.pi/180)*latitude2 radLng1 = (math.pi/180)*longitude1 radLng2= (math.pi/180)*longitude2 #ref: http://www.alivenode.com/index.php/archives/300 d=2.0*math.asin(math.sqrt(math.pow(math.sin((radLat1-radLat2)/2.0),2)+math.cos(radLat1)*math.cos(radLat2)*math.pow(math.sin((radLng1-radLng2)/2.0),2)))*radius return d
相关文章推荐
- Python计算地图上两点经纬度间的距离
- 计算球面两点间距离实现Vincenty+Haversine
- python根据经纬度计算两点距离
- 百度地图之调用URL api接口实现周边搜索及计算球面两点间的距离
- 如何运用Python计算地图上两点的实际距离
- 球面两点间的球面距离的计算
- 一行Python代码计算两点间曼哈顿距离
- python实现根据两点经纬度计算实际距离
- 根据经纬度计算两点球面距离
- 球面两点间的球面距离的计算(2)
- 计算wgs84球面两点的距离
- python利用地图两个点的经纬度计算两点间距离
- 计算球面上两点间最短距离多语言版本
- 用Python根据两点经纬度计算距离
- 球面上两点之间的距离计算
- GoogleEarth计算地球球面两点距离
- python 计算地球上两点距离和方位角(bearing)的包geographiclib
- 根据经纬度计算两点球面距离
- [html] PHP使用Google map web services来计算两点间的距离 -- Compute the distance between two place via Google map services in PHP
- 根据经纬度坐标计算两点间几何距离