GPS/GIS 计算:基于运动/mph 预测未来位置的算法?

GPS/GIS Calculations: Algorithm to predict future position based on movement/mph?(GPS/GIS 计算:基于运动/mph 预测未来位置的算法?)
本文介绍了GPS/GIS 计算:基于运动/mph 预测未来位置的算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在导航应用中寻找资源或算法来计算以下内容:

Looking for resources or algorithm to calculate the following in a navigation app:

如果我当前的 GPS 位置是 (0,0),并且我以每小时 15 英里的速度前进 32 度,我如何计算我在 10 秒内的位置?

If my current GPS position is (0,0) and I'm heading 32 degrees at 15 miles per hour, how can I calculate what my position will be in 10 seconds?

即:GPSCoordinate predictCoord = GPSCoordinate.FromLatLong(0, 0).AddByMovement(32, 15, TimeSpan.FromSeconds(10));

当前代码基于以下答案:

Current code based on answer below:

public GPSCoordinate AddMovementMilesPerHour(double heading, double speedMph, TimeSpan duration)
{
    double x = speedMph * System.Math.Sin(heading * pi / 180) * duration.TotalSeconds / 3600;
    double y = speedMph * System.Math.Cos(heading * pi / 180) * duration.TotalSeconds / 3600;

    double newLat = this.Latitude + 180 / pi * y / earthRadius;
    double newLong = this.Longitude + 180 / pi / System.Math.Sin(this.Latitude * pi / 180) * x / earthRadius;

    return GPSCoordinate.FromLatLong(newLat, newLong);
}

推荐答案

这是完整的参数答案:

变量:

  • heading :航向(即从方位角 0° 向后的角度,以度为单位)
  • speed:速度(即速度向量的范数,以英里/小时为单位)
  • lat0, lon0 : 以度为单位的初始坐标
  • dtime : 从起始位置开始的时间间隔,以秒为单位
  • lat, lon : 以度为单位的预测坐标
  • pi : pi 常数 (3.14159...)
  • Rt : 地球半径 miles(6378137.0 米,相当于 3964.037911746 英里)
  • heading : heading (i.e. backwards angle from azimuth 0°, in degrees)
  • speed : velocity (i.e. norm of the speed vector, in miles/hour)
  • lat0, lon0 : initial coordinates in degrees
  • dtime : time interval from the start position, in seconds
  • lat, lon : predicted coordinates in degrees
  • pi : the pi constant (3.14159...)
  • Rt : Earth radius in miles (6378137.0 meters which makes 3964.037911746 miles)

在一个(东、北)局部坐标系中,时间间隔后的位置是:

In an (East, North) local frame, the position after the time interval is :

x = speed * sin(heading*pi/180) * dtime / 3600;
y = speed * cos(heading*pi/180) * dtime / 3600;

(坐标以英里为单位)

您可以从那里计算 WGS84 帧中的新位置(即纬度和经度):

From there you can compute the new position in the WGS84 frame (i.e. latitude and longitude) :

lat = lat0 + 180 / pi * y / Rt;
lon = lon0 + 180 / pi / sin(lat0*pi/180) * x / Rt;

更正最后一行:*sin(phi) 为/sin(phi)

Edit : corrected the last line : *sin(phi) to /sin(phi)

这篇关于GPS/GIS 计算:基于运动/mph 预测未来位置的算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)