Search code examples
mathcoordinatescoordinate-systems

Mathematic way to know 50 km around an specific coordinate


I'm investigating about the best way to know what coordinates are around an specific coordinate. I mean: If am in the coordinate:

@29.817178,-95.4012915

How I can know if the coordinate: @30.00121, -93.13213 has 50km (or less) of my actual position?


Solution

  • Since you're dealing with latitude and longitude, you need to calculate the great circle distance between your two points.

    The formula is a bit detailed so I won't reproduce it here, but it's explained in the above linked Wikipedia article.