考虑到两者之间的距离

考虑到两者之间的距离

本文介绍了考虑到两者之间的距离,如何从给定点找到一个点的纬度和经度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到距离当前点一些X公里的点A,



如果我知道中心点的纬度和经度我怎样才能获得周长四点的纬度,经度......我正在寻找相当的很久但无法在JavaScript或Java中获得解决方案...距离在我的情况下将在几公里,所以不能认为地球是平坦的表面,所以PLZ不建议这样的解决方案...



'p>由于

解决方案

看一看,详细解释了使用JavaScript示例进行距离计算的球形模型:

JavaScript:

  var lat2 = Math.asin( Math.sin(lat1)* Math.cos(d / R)+ 
Math.cos(lat1)* Math.sin(d / R)* Math.cos(brng));
变种lon2 = lon1 + Math.atan2(Math.sin(方位角)* Math.sin(d / R)* Math.cos(LAT1),
Math.cos(d / R)-math .sin(LAT1)* Math.sin(LAT2));


I want to find the point which is some X kms from the current point say A,

if I know the latitude and longitude of center point How can I get the latitude, longitude of four points at circumference.... I am searching SO for quite long but not able to get the solution in JavaScript or in Java... distance In my case will be in few kms so cant consider earth as flat surface so plz dont suggest such solution...

Thanks

解决方案

Take a look at this page which explains in great detail the spherical model for distance calculation with JavaScript examples:

JavaScript:

var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) +
                      Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );
var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),
                             Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));

这篇关于考虑到两者之间的距离,如何从给定点找到一个点的纬度和经度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 06:53