title: GPS/GIS Calculations: Algorithm to predict future position based on movement/mph?
body: <p>Looking for resources or algorithm to calculate the following in a navigation app:</p>
  
  <p>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?</p>
  
  <p>i.e.: <code>GPSCoordinate predictedCoord = GPSCoordinate.FromLatLong(0, 0).AddByMovement(32, 15, TimeSpan.FromSeconds(10));</code></p>
  
  <p><strong>Edit:</strong> Current code based on answer below:</p>
  
  <pre><code>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);
  }
  </code></pre>