As the title suggests, I am trying to generate a coordinate based on another coordinate that is within an x mile (or whichever unit is most convenient) radius of the inputted one.
As an example:
- I am given a geographic coordinate (lat, lon) of 39.083056, -94.820200.
- I want to be returned another set of coordinates that is within a x miles radius of that coordinate, such as 39.110998, -94.799668.
- The x mile radius isn't as important as the fact that the returned coordinates are within that x mile radius.
I have searched and searched, but I must be searching the wrong thing because all the posts that I have been able to find seem like they get very close to what I am trying to do but aren't quite hitting the nail on the head.
I'm sorry you're being downvoted to oblivion. I understand it can be frustrating trying to search for something without knowing what exactly to search for.
You may be interested in Orthodromic Lines/Distances: wiki. If this answer doesn't fulfil your needs, at least you have a new term to google and hopefully will lead you to one that does suit.
You could try using the Geo library. Its documentation is on the sparse side, but it does contain a method that could be useful to you:
CalculateOrthodromicLine(startPoint, heading, distance)
A pseudocode would be something as simple as this:
Edit: As mentioned in the wiki, the Earth is not a perfect sphere, but a spheroid instead. The library's
GeoContext.Current
by default uses itsSpheroid
calculations, so you should be okay.Good luck!