Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lat/long to bearing

Status
Not open for further replies.

elck

Programmer
Apr 19, 2004
176
NL
Hi all,

Suppose I have two coordinates like

Lat 28,00123 E Long 33,00001 S
and
Lat 28,00123 E 34,76501 S

How could I calculate the bearing in degrees of that track?

The math is simply to hard for me!:(


 
PHP

I have an EXCEL answer, but that makes no sense to me.
It read likes this, anyone feel like translating this??

Code:
=ROUND(IF(D8=F8;IF(C8>E8;0;180);IF(SIN(D8*PI()/180-F8*PI()/180)<0;ACOS((SIN(-E8*PI()/180)-SIN(-C8*PI()/180)*COS(ACOS(SIN(-C8*PI()/180)*SIN(-E8*PI()/180)+COS(-C8*PI()/180)*COS(-E8*PI()/180)*COS(-D8*PI()/180+F8*PI()/180))))/(SIN(ACOS(SIN(-C8*PI()/180)*SIN(-E8*PI()/180)+COS(-C8*PI()/180)*COS(-E8*PI()/180)*COS(-D8*PI()/180+F8*PI()/180)))*COS(-C8*PI()/180)))*180/PI();(2*PI()-ACOS((SIN(-E8*PI()/180)-SIN(-C8*PI()/180)*COS(ACOS(SIN(-C8*PI()/180)*SIN(-E8*PI()/180)+COS(-C8*PI()/180)*COS(-E8*PI()/180)*COS(-D8*PI()/180+F8*PI()/180))))/(SIN(ACOS(SIN(-C8*PI()/180)*SIN(-E8*PI()/180)+COS(-C8*PI()/180)*COS(-E8*PI()/180)*COS(-D8*PI()/180+F8*PI()/180)))*COS(-C8*PI()/180))))*180/PI()));0)

But rather I hope someone has an answer that is a little simpeler!
 
Looks good, Sleipnir, I'll dig into that.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top