计算起点和终点之间的坐标
给定..
1 - 起点 GPS 坐标,
2 - 终点 GPS 坐标,
3 - 物体行进的速度,
4 - 知道行程轨迹将是一条直线...
我如何计算出 n 分钟后我的 GPS 坐标将是什么?也就是说,如何计算我在行程开始后到行程结束前的某个时间点的位置?
Given..
1 - The start-point GPS coordinates,
2 - The end-point GPS coordinates,
3 - The speed at which the object is travelling,
4 - Knowing that the trip trajectory will be a straight line...
How can I calculate what my GPS coordinated will be in n minutes' time? That is to say, how can I calculate my position at a given time after the trip has started before the trip has ended?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用 Thaddeus Vincenty 公式
这将为您提供两个 GPS 坐标之间的距离(经度/纬度)。
然后简单地
假设匀速,这是一个粗略的估计。
You need to use the Thaddeus Vincenty Formulae
This will give you the distance between two GPS co-ordinates (lon/lat).
Then simply do
Assuming uniform speed, its a gross estimation.
这种方法仅对于小距离来说足够准确,因为没有考虑地球的曲率。您可以将伪球坐标转换为平面坐标,但对于距离较大且需要精度的情况,不同的方法可能会更好。
关键是计算起点和终点之间的总距离。您可以使用欧几里得距离,但是,如上所述,这仅对于较小的距离来说相当准确:
然后您就知道走完整个距离需要多长时间:
由此,您可以计算该距离的百分比在给定
时间
的情况下,您从start
到end
行驶的距离:最后,插值:
This method is accurate enough only for small distances, because the curvature of the Earth is not accounted for. You can convert pseudo-spherical coordinates to planar coordinates, but a different method would probably be better for cases where the distance is large and accuracy is needed.
The key is to calculate the total distance between the start and end points. You can use Euclidean distance but, as stated, this is reasonably accurate only for smaller distances:
You then know how long it will take to travel the entire distance:
From this, you can calculate the percentage of the distance you have traveled from
start
toend
giventime
:Finally, interpolate: