Calculating Latitude/Longitude X miles from point?

  • I am wanting to find a latitude and longitude point given a bearing, a distance, and a starting latitude and longitude.

    This appears to be the opposite of this question (Distance between lat/long points).

    I have already looked into the haversine formula and think it's approximation of the world is probably close enough.

    I am assuming that I need to solve the haversine formula for my unknown lat/long, is this correct? Are there any good websites that talk about this sort of thing? It seems like it would be common, but my googling has only turned up questions similar to the one above.

    What I am really looking for is just a formula for this. I'd like to give it a starting lat/lng, a bearing, and a distance (miles or kilometers) and I would like to get out of it a lat/lng pair that represent where one would have ended up had they traveled along that route.

    Are you looking for a tool that does this (like Esri's pe.dll) or a formula?

    Sorry I wasn't specific... I am looking for a formula. I'll update my question to be more specific.

    Bunch of worked out math samples are here Calculate distance, bearing and more between Latitude/Longitude points which includes the solution to "Destination point given distance and bearing from start point".

    here's the page that link to lat/long calculations Lat/long calculations also this page Lat/long calculations there's a code + calculator

  • I'd be curious how results from this formula compare with Esri's pe.dll.

    (citation).

    A point {lat,lon} is a distance d out on the tc radial from point 1 if:

     lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
     IF (cos(lat)=0)
        lon=lon1      // endpoint a pole
     ELSE
        lon=mod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi
     ENDIF
    

    This algorithm is limited to distances such that dlon < pi/2, i.e those that extend around less than one quarter of the circumference of the earth in longitude. A completely general, but more complicated algorithm is necessary if greater distances are allowed:

     lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
     dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat))
     lon=mod( lon1-dlon +pi,2*pi )-pi
    

    Here's an html page for testing.

    Thank you for the quick reply. Let me digest some of this information, and I will get back with you. On the surface, though, this looks spot on.

    I tried the direct case using pe.dll (actually libpe.so on solaris) after retrieving the distance and the forward azimuth from the html page for 32N,117W to 40N,82W. Using 32N,117W,d=3255.056515890041,azi=64.24498012065699, I got 40N,82W (actually 82.00000000064).

    Awesome! Thank you very much for the link to the Aviation Formulary article by Ed Williams, I had not seen this before but it has thus far proven to be a great read. Just a note for anyone looking at this in the future, the inputs and outputs of this formula are ALL in radians, even the distance.

    What is the unit of distance in this formula?

    There are two links in this answer that appear to be broken which is being used to justify asking what may be the same question again: https://gis.stackexchange.com/q/243233/115

    @PolyGeo I've fixed the links

    @KarthikMurugan Ed's intro says distance units are in radians along a great circle.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM