算法来预测基于移动

算法来预测基于移动

本文介绍了GPS / GIS计算:算法来预测基于移动/英里的未来持何立场?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找资源或算法来计算在导航应用如下:



如果我当前GPS位置为(0,0),我得走32度?以每小时15哩,我怎么能计算我的位置将在10秒是什么



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



修改当前根据下面的答案代码:

 公共GPSCoordinate AddMovementMilesPerHour(机车重联,双speedMph,时间跨度长)
{
双X = speedMph * System.Math.Sin(税号* PI / 180)* duration.TotalSeconds / 3600;
双Y = speedMph * System.Math.Cos(税号* PI / 180)* duration.TotalSeconds / 3600;

双newLat = this.Latitude + 180 / PI * Y / earthRadius;
双NEWLONG = this.Longitude + 180 / PI / System.Math.Sin(this.Latitude * PI / 180)* X / earthRadius;

返回GPSCoordinate.FromLatLong(newLat,NEWLONG);
}


解决方案

下面是完整的参数答案



变量:




  • 标题:标题(从方位角0°即向后的角度,以度)

  • 速度:速度(即规范速度矢量,以英里/小时)

  • lat0 lon0 :初始协调度

  • DTIME :时间间隔从起始位置,以秒为单位

  • 经纬度 LON :以度预测坐标

  • PI :在 PI 的常数(3.14159 ...)

  • 保留时间 :在地球半径的英里的(6378137.0米这使得3964.037911746英里)



在一个(东,北)本地帧,时间间隔后的位置是:

  X =速度*罪(税号* PI / 180)* DTIME / 3600; 
:Y =速度* COS(税号* PI / 180)* DTIME / 3600;



(在英里坐标)



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

 经纬度= lat0 + 180 / PI * Y / RT; 
LON = lon0 + 180 / PI /罪(lat0 * PI / 180)* X / RT;



编辑:修正的最后一行:*罪(PHI)到/罪(PHI)


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

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?

i.e.: GPSCoordinate predictedCoord = GPSCoordinate.FromLatLong(0, 0).AddByMovement(32, 15, TimeSpan.FromSeconds(10));

Edit: 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);
}
解决方案

Here is the complete parametric answer :

variables :

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

(with coordinates in miles)

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;

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

这篇关于GPS / GIS计算:算法来预测基于移动/英里的未来持何立场?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:27