Search code examples
algorithmcoordinatescoordinate-transformation

Algorithm for adding and translating lat/long coordinates


Hello I'm looking for an algorithm that would let me add degrees for an specific coordinate. So let's suppose I have the following position -0.31399363,-78.44437. I have an image where I assume that this position is pointing north, now I want to be able to create another position that would have +30 degrees longitude offset, and is 100m farther from the initial point. I have been looking on internet, and I found some calculations in order to transforma Decimal coordinates to Degrees, I think that's the starting point, but I couldn't figure how to translate decimal coordinates according to distance. Thanks a lot.


Solution

  • I'm not entirely certain I understand the question, but to determine distances and bearings between lat/long coordinates, you can use the Haversine formula. It sounds to me like that, or something that can be derived from it, is what you are looking for.