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);
}
will explain you everything – Faruk Dec 17 '13 at 03:45