考虑到两者之间的距离,如何从给定点找到一个点的纬度和经度? [英] How to find the latitude and longitude of a point from a given point, given the distance between the two?

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

问题描述

我想找到距离当前点一些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:

Given a start point, initial bearing, and distance, this will calculate the destination point and final bearing travelling along a (shortest distance) great circle arc.

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));

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆