# Compute difference in lon / lat when moving at angle

I have the following problem: I have been given an origin as a lon / lat pair, a distance in kilometers and an angle on the ground, relative to the cardinal directions. My goal is to compute the destination (as a lon / lat pair) which is reached after moving in the direction given by the angle for the given distance.

How might I go about computing the destination? Is there a closed formula?

• Kilometres are only really calculatable in a projected coordinate system, your input and output are geographic.. your workflow would have to be project input into metres, calculate a new point from kilometre offset to generate the destination in projected coordinates and project the destination to geographic.. for this you will need software, what GIS software or API do you have available? The next real challenge is finding a projected coordinate system that doesn't distort bearings too much - and that is a new question unto itself... how accurate does this need to be? Feb 15, 2018 at 21:45
• Well, I am using `pyqgis`. The distance is a little less than 300 kilometers, but I would have thought that this is a well posed problem: After all there should only be one great circle containing the origin and having the required (local) degree should't it? Feb 15, 2018 at 22:39
• @hfhc2 A great circle is on a sphere. The earth is better modeled as an ellipsoid which complicates the equations. See geodetic problems section in Wikipedia. How accurate does the target coordinate need to be? Feb 15, 2018 at 22:55
• OK, true. I think a spheric model is quite sufficient for me at this point. Feb 15, 2018 at 22:56
• Remember that great circles on a spherical earth have continually changing Azimuth (direction relative to true north), except for those through the poles or around the equator. For very short distances, this can be ignored, but at 300 km along the surface, this would make a difference, so you need to be clear about what you mean by azimuth. See - en.wikipedia.org/wiki/Azimuth#/media/… Feb 15, 2018 at 23:46