prime programming / great circle formulae  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: prime programming / great circle formulae (/thread251406.html) 
prime programming / great circle formulae  Geoff Quickfall  09262013 Hello from an ABSOLUTE newbie to the Prime: just got back from HHC2013 and of course the focus was on the Prime. Just so the 34S crowd does not get to upset I did pick up three new overlays from Eric: thanks Eric. Plan on leaving one on the prize desk for next year fully loaded with IR, Clock ... Back to the Prime; yes I can read the whole manual (I will) but I want to get to the programming and I learn that by looking at others examples. The program is simple, I have done it in RPN, Basic, RPL, Fortran but not in Prime of course. This would be a simple Great Circle program using four inputs,
LAT1 being the departure(1) and the arrival (2) latitudes and longitudes. the formulae for distance is:
=ACOS(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2lon1))*6371 the formulae for initial track (bearing) is:
è =ATAN2(COS(lat1)*SIN(lat2)SIN(lat1)*COS(lat2)*COS(lon2lon1), *note that the formulae for bearing reverses the arguments to ATAN2 – see notes below Since atan2 returns values in the range ð ... +ð (that is, 180° ... +180°), to normalise the result to a compass bearing (in the range 0° ... 360°, with ve values transformed into the range 180° ... 360°), convert to degrees and then use (è+360) % 360, where % is modulo. For final bearing, simply take the initial bearing from the end point to the start point and reverse it (using è = (è+180) % 360). I am trying not to be lazy here but any takers? Cheers, Geoff
Edited: 26 Sept 2013, 3:50 p.m.
Re: prime programming / great circle formulae  David Hayden  09262013 Quote: Geoff, I think you mentioned in your HHC2013 talk that your great circle distance calculations sometimes don't match the onboard computer and you attributed it to the large size (10 miles) of airports. The calculation above appears to assume that the earth is perfectly round. In fact, it's oblong, stretched at the equator by centrifugal force. I know there's a more accurate equation in one of my astronomy books, but I can't find it at the moment.
Dave
Re: prime programming / great circle formulae  Eddie W. Shore  09262013 Will this work?
EXPORT GREATCIR(lat1, lon1, lat2, lon2) Re: prime programming / great circle formulae  Dave Shaffer (Arizona)  09262013 This which leads to this lead you to the gory details!
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 Both Dave's are correct. The formula used is from the FAA charts and is very accurate over short distances, say between waypoints of 100 miles. In the talk the gross navigational check between the two distant airports is accurate enough. A few compounding errors enter; is an oblate spheroid correction being used by the FMC, (i will look into that, the manual is 1500 pages) and which datum points are the start and terminus; centre of aerodrome or primary navigational fix? Eddie, well done, I will enter this and use it as a teaching ( why is part of the word teaching; aching?) exercise. Should I place the calc in exam mode with blinking lights :) Thanks Eddie and thanks for the comments at your blog. It is fun to use the calcs at work. The 41CL will make it back to my lab when I get back to school. Cheers, all
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 Hi Eddie, Add another bracket after the last line before the semi colon.
B:=ATAN((SIN(lon2lon1)*COS(lat2))/
I like this! Thanks so much Eddie!
Geoff
Re: prime programming / great circle formulae  Maximilian Hohmann  09272013 Hello!
Quote: Not in ours (Honeywell GNSXL).
Quote: In ours: ARP (aerodrome reference point). Can be anywhere.
Regards, Re: prime programming / great circle formulae  Eddie W. Shore  09272013 You are welcome, Geoff. I am glad you find it useful. Just curious how where the 6,371 constant came from?
Re: prime programming / great circle formulae  Ken Shaw  09272013 I think this is the assumed radius of the earth in Km (ignoring oblation).
Otherwise, the formula doesn't give a distance.
Re: prime programming / great circle formulae  hugh steers  09272013
Here http://www.voidware.com/dist.html
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 Hugh: Will do Hugh. I have the whole weekend off in London during your next meeting. I will be there for the AGM and all day Sunday. Max, Try the following on your Honeywell: When flying east to west or vice versus set up three lines of longitude at 90 degrees to your course with varying lengths, in front of your nose. For example if flying from 60N60W to 60N70W set up the following when passing 60W. Create a disco after your destination airport and insert the following three lines along the same longitude, then create a disco after each line,
65N65W to 55N65W short line @ 600nm Use Plan mode and 'step' to the new lines in the legs page. You will see three distinct lines! Since it is the same longitude 65W what gives? Interesting mind game with your fellow pilot. These lines converge and are coincident when the aircraft crosses the 65W point then they diverge again. In fact it looks like the lines bisect the earth, the shortest line sitting near the surface, while the longer lines deeper under the surface. As you fly over the 65W longitude you are looking directly down on all three lines. It would seem that the shortest distance between to distant points is through the earth and not along the surface. For those of you to familiar with FMC/CDU operations we use much shorter distances. The longest distance between two ponts on my flight plans has been 900nm. Therefore the 'burrowing' earth track does not show up. Also, 1 degree of latitude is 60 mm. Just my explanation, maybe a talk with Honeywell or you may come up with a better one! Eddie, Thanks, already learned enough for rudimentary programming inputs, now to fancy things up. A pleasure seeing you again. Geoff
Edited: 27 Sept 2013, 1:00 p.m.
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 Correct!
Re: prime programming / great circle formulae  Jim Horn  09272013 Wow, thank you Geoff and Daves! From 1981 through 1990 I was in charge of collecting and reducing the data for the CAFE air races held in California. To compute the distances involved, I used the algorithms in the RAND report "Hand Calculator Programs for Staff Officers" (1976) which used the oblate spheroid model. I added corrections for increased earth radius due to flight altitude and slant range increases due to climbing and descending. But I didn't know about or use the more recent algorithms or spheriod model you've pointed me to. Fascinating! I'll have to play with the Prime emulator and try getting this to run on same. Should be both fun and informative.
Best to you, Maximilian and all pilots!
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 Missed you at the meet Jim. I have always known that the altitude of the flight is not incorporated into the distance ACTUALLY flown. I just never took it to your level (pun intended) with corrections. Of course I am just checking the ground based but adding 40,000' to the equation does make a difference to the radius!
Cheers
Re: prime programming / great circle formulae  Geoff Quickfall  09272013 P.s. playing with the prime is fun! Now if it could only print on my infrared.
Re: prime programming / great circle formulae  Kimberly Thompson  09272013 Loquitor for the curious ...
Quote: Link to Hand Calculator Programs for Staff Officers ... BEST!
SlideRule
