寻找资源或算法来计算在导航应用程序中的以下内容:GPS/GIS计算:基于运动/ mph预测未来位置的算法?
如果我当前的GPS位置是(0,0),我以每小时15英里的速度前进32度,我怎么才能计算出我的位置将在10秒内?
即:GPSCoordinate predictedCoord = GPSCoordinate.FromLatLong(0, 0).AddByMovement(32, 15, TimeSpan.FromSeconds(10));
编辑:基于下面的答案当前代码:
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);
}
。如果汽车在行驶的街道上,你可能要遵循街道,而不是线性外推的半径。 – CodesInChaos 2011-02-05 20:36:49
@CodeInChaos在这种情况下,我确实想要线性;这并没有采取接地路径考虑(也许以后!) – Brandon 2011-02-05 21:23:55