I'm looking for an algorithm which when given a latitude and longitude pair and a vector translation in meters in Cartesian coordinates (x,y) would give me a new coordinate. Sort of like a reverse Haversine. I could also work with a distance and a heading transformation, but this would probably be slower and not as accurate. Ideally, the algorithm should be fast as I'm working on an embedded system. Accuracy is not critical, within 10 meters would be good.
|
|
If your displacements aren't too great (less than a few kilometers) and you're not right at the poles, use the quick and dirty estimate that 111,111 meters (111.111 km) in the y direction is 1 degree (of latitude) and 111,111 * cos(latitude) meters in the x direction is 1 degree (of longitude). |
|||||||||||||||||
|
|
As Liedman says in his answer Williams’s aviation formulas are an invaluable source, and to keep the accuracy within 10 meters for displacements up to 1 km you’ll probably need to use the more complex of these. But if you’re willing to accept errors above 10m for points offset more than approx 200m you may use a simplified flat earth calculation. I think the errors still will be less than 50m for offsets up to 1km.
This should return:
|
|||||||||||||||||
|
|
I find that Aviation Formulary, http://williams.best.vwh.net/avform.htm, is great for these types of formulas and algorithms. For your problem, check out the "lat/lon given radial and distance": http://williams.best.vwh.net/avform.htm#LL. Note that this algorithm might be a bit too complex for your use, if you want to keep use of trigonometry functions low, etc. |
||||
|