Formula to find heading from coordinates

Hi all.

Further to somes posts I've seen concerning the difficulty of finding planetary coordinates, I've adapt a tool I have at my work.
Aim was to find a formula with starting and destination coordinates that can give an heading to proceed to the destination.

I've found it, and after some tests , I'm sharing it here .

Be aware that this is only usable when we have the heading on the HUD.

Feel free to use it in all of your great third-party tools.

Considering:


Starting Coords: LAT1 / LONG1 (ingame format)
Destination Coords: LAT2 / LONG2 (ingame format)


Planet radius = R


First you have to convert these coordinates from Degrees to Rad.


Code:
LATr1= LAT1 x PI /180
LONGr1=LONG1 x PI / 180
LATr2= LAT2 x PI /180
LONGr2=LONG2 x PI / 180


Heading to take to destination:

Code:
=MOD(ATAN2((COS(LATr1)*SIN(LATr2))-(SIN(LATr1)*COS(LATr2)*COS(LONGr2-LONGr1));SIN(LONGr2-LONGr1)*COS(LATr2));2*PI()) x 180 / PI()


Entire value is enough precise !!


Distance to destination :


Code:
ACOS((COS(LATr1)*COS(LATr2)*COS((-1*LONGr2)-(-1*LONGr1)))+(SIN(LATr1)*SIN(LATr2)))*R


I have no skills in coding, so I've done only a spreadsheet you can find here.

Already imported in Pytheas site (french site) :

269061ee21.png
 
Last edited:
Hi Ian,

great work, and thanks for sharing. However, I don't seem to have access to the linked google doc. Can you change this, please?

Thanks again, CMDR The Tick
 
Hi Ian,

great work, and thanks for sharing. However, I don't seem to have access to the linked google doc. Can you change this, please?

Thanks again, CMDR The Tick

Ditto. Great idea. Even if we cant get access we could always input the formula manually anyway into excel.
 
+1 rep for your hard work :)
I won't be using it because I love messing about in different directions and watching my LAT & LON until I am going the right way :D
 
Last edited:
I've created a little app for Windows based on your formula work above Ian Baristan. I'll post the links to it etc once I've made it a little more robust etc For those that can't cope with a French language website it might offer another solution :)
 
I've created a little app for Windows based on your formula work above Ian Baristan. I'll post the links to it etc once I've made it a little more robust etc For those that can't cope with a French language website it might offer another solution :)

Oh wow! :cool:

*waits in anticipation*
 
Hahaha! That distance formula is the Haversine formula! :)

I didn't think that a distance tool I used for Ingress might have any application in ED.
Well done on putting it together Ian!
 
Back
Top Bottom