当前位置:网站首页>经纬度转换为距离
经纬度转换为距离
2022-06-21 16:05:00 【轩渊】
private Double get_distanse(locate a,locate b){
Double result=0.00;
Double ra=6378140.0;
Double rb=6356755.0;
Double lat_a=Math.toRadians(a.getLatitude());
Double lat_b=Math.toRadians(b.getLatitude());
Double lon_a=Math.toRadians(a.getLongitude());
Double lon_b=Math.toRadians(b.getLongitude());
double pa = Math.atan(rb / ra * Math.tan(lat_a));
double pb = Math.atan(rb / ra * Math.tan(lat_b));
double x = Math.acos(Math.sin(pa) * Math.sin(pb) + Math.cos(pa) * Math.cos(pb) * Math.cos(lon_a - lon_b));
double c1 = (Math.sin(x) - x) * Math.pow((Math.sin(pa) + Math.cos(pb)), 2) / Math.pow(Math.cos(x / 2), 2);
double c2 = (Math.sin(x) - x) * Math.pow((Math.sin(pa) - Math.cos(pb)), 2) / Math.pow(Math.cos(x / 2), 2);
double flatten = (ra - rb) / ra;
double dr = flatten / 8 * (c1 - c2);
result=ra*(x+dr);
result=result/1000;
return result;
}
边栏推荐
- Move Protocol Beta测试版再调整,扩大总奖池
- [MySQL learning notes 13] comprehensive exercise of query statements
- uni-app框架学习笔记
- Android kotlin class delegation by, by lazy key
- Redis6.0新特性(上)
- 【毕业N年系列】 毕业第四年
- The fundamental task of Natural Science
- Android kotlin 类委托 by,by lazy关键
- path.join() 、path.basename() 和 path.extname()
- StarkRocks 第二讲 基本操作(1)
猜你喜欢

第八章 可编程接口芯片及应用【微机原理】

Three color mark removal method

Redis6.0新特性(上)

Vector data download for mainland and global epidemic data, based on geo JSON to SHP

导数常用公式__不定积分常用公式

Qt 知识:使用 QGraphicsPixmapItem类
![[MySQL learning notes 18] constraints](/img/29/c72f83bfae8fd8b43e78cdf1aa9cbc.png)
[MySQL learning notes 18] constraints

【没搞懂路由策略?盘它!】
![[MySQL learning notes 19] multi table query](/img/e6/4cfb8772e14bc82c4fdc9ad313e58a.png)
[MySQL learning notes 19] multi table query

Common formula of derivative__ Common formulas of indefinite integral
随机推荐
compose 编程思想
窗帘做EN 1101易燃性测试过程是怎么样的?
Design a print function to print the whole tree
Exness: the impact of inflation in the United States is too great, and the leaders of the Federal Reserve have expressed their position one after another
[MySQL learning notes 14] DQL statement execution sequence
iframe跨域传值
Starkrocks Lecture 2 basic operation (1)
rtmp webrtc 协议 openssl 等安装
贝叶斯公式的两种理解
fs.readFile() 和 fs.writeFile()
程序员进修之路
【mysql学习笔记11】排序查询
函数调用模型
牛客网:大数加法
List set map in kotlin
[MySQL learning notes 11] sort query
Niuke.com: large number addition
从北京“润”到芝加哥,工程师宝玉“滋润”成长的秘诀
Set up your own website (11)
Design and implementation of face verification system for floating population management