尋找資源或算法來計算在導航應用程序中的以下內容: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