![]() |
Converting Great Circle Navigation from 41C to 42S - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Converting Great Circle Navigation from 41C to 42S (/thread-255418.html) |
Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-10-2013 On my HP-42S, I tried carefully transcribing the entire Great Circle (GC) program from the HP-41 Nav Pac, and all of the supporting subroutines. It almost works, but not quite. The original program doesn't quite seem to handle a two line display correctly. On the 41, the GC program flawlessly accepts two lat/long inputs, and it provides an azimuth in degrees and the distance in nautical miles that would be required when sailing along the surface of a sphere from point one to point two. I noticed a smaller version of a GC program had been written for the HP-67, so that could be easier to translate to the 42S. I would prefer to have both the GC and GCPOS programs transferred from the HP-41 because I have used them so often. Would it be against copyright if I were to figure out how to share my printout of the HP-41 Nav Pac files? Would anyone familiar with the 42S be interested in adapting the code?
Re: Converting Great Circle Navigation from 41C to 42S - Kimberly Thompson - 11-10-2013 Bill I have both - willing to give it a go. I've had some success with similiar forum-member proposals. I seem to recall a GC routine for the 42 (somewhere in my archives) as a reference. I'll start looking.
Found ONE 42 program - from the following ... LBL "GC" BEST! SlideRule edited to include 42s listing & source
Edited: 10 Nov 2013, 12:03 p.m.
Re: Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-10-2013 Thanks. The code from the 42S example you found is about ten times smaller than the code from the 41C Navigation Module. That made me think. Most of the larger 41C program panopoly seems to exist to provide convenient user input/output in DD.MMSS format. It looks as if all of the internal calculations are actually done using converted decimal degree versions of the numbers, so the part of the 41C code that actually does the work is also very small. The math looks a bit different from the 42S example. From the 41C Navigation Module, these are the two subroutines that seem to do all of the GC math:
LBL "*GC" Use decimal degrees. Put latitude north #1 in memory 07. Put longitude west #1 in memory 08. Put latitude north #2 in memory 09. Put longitude west #2 in memory 10. Then, XEQ "*GC" to see heading in degrees in the Y register, and distance in nautical miles in the X register. The code from the 42S version seems more compact, so we should also test it to see whether it correctly handles units and angles that are negative or larger than 180 degrees.
Edited: 10 Nov 2013, 9:45 p.m.
Re: Converting Great Circle Navigation from 41C to 42S - Geoff Quickfall - 11-10-2013 Problem with the sin, cos GC program is that it cannot calculate for due north or south tracks. Therefore you must test for a track between two points that are on the same longitude. If true, subtract the two latitudes and multiply that by 60nm to find the GC distance and the track will be either 000 or 180. Or Use the following code for the 42s as it doesn't care about due north or south. Also south and east are negative.
LBL GC Re: Converting Great Circle Navigation from 41C to 42S - Kimberly Thompson - 11-11-2013 Bill & Geoff
Another interesting read for the HP-41... Re: Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-11-2013 The PDF is quite a resource library. It has more than a thousand program steps of HP-41 code. I will look at the HD program. It is too bad there wasn't a ROM input routine in the 41 or 42 that would allow a user to directly input or edit an angle in degrees minutes and seconds.
Re: Converting Great Circle Navigation from 41C to 42S - Kimberly Thompson - 11-11-2013 Bill
A few additional references (just for the record) edited for typo(s)
Edited: 11 Nov 2013, 6:11 p.m.
Re: Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-11-2013 I can't imagine how you were able to find these, but thanks. The formula for distance on page 91 of the 41C manual produces exactly the same numeric result for distance as the GC program from the 41 Nav Pac. I also discovered a laser program in one of the references that I needed for a different project, random convergence. Programming the 42S, I would like the output display to show two numbers simultaneously, each with units. In the Odysseus example on page 91/92 of the manual, the output display would be as follows:
17.2 deg Presently, I can make one value appear with a unit label on the top line, but with an extraneous number dodging about on the bottom line. Then, after a pause and resume I can display the second output value on the top line, but with a different extraneous number sitting on the bottom line.
The only 42S example I found for creating a two line output seems to work only for purely alpha text messages using a line feed character. Edited: 11 Nov 2013, 10:33 p.m.
Re: Converting Great Circle Navigation from 41C to 42S - Geoff Quickfall - 11-12-2013 How accurate does the GC distance and True track need to be. I usually display both GC distance and true track on the same line by doing the following:
Calculate GC distance take integer portion "IP" in 42s lingo.
Edited: 12 Nov 2013, 5:19 a.m.
Re: Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-12-2013 For the two line 42S, it is also possible to pop the two values into the X and Y stack locations where they will both be visible, and exit. Putting units beside each output number would help a user avoid accidentally swapping the values in cases where the program has not been used in a few months, and the numeric values for direction and heading are similar. For example:
Lat1 = 39 deg 10 min
Lat2 = 39 deg 38 min
39.47 deg (or 39 deg 28 min) heading For now, I am stuck with my old HP-41 habit of just displaying each of two output numbers with units one at a time. It just seems a waste to have a perfectly good second display line, and not know how use it.
Re: Converting Great Circle Navigation from 41C to 42S - Bill Triplett - 11-12-2013 OK, there is a way. Suppose in the HP-42S we have the following numbers in the X and Y registers:
Y: 39.47 The value in Y is heading clockwise from north in decimal degrees. The value in X is distance in nautical miles. The following code simultaneously displays both numbers with units:
CLA
Re: Converting Great Circle Navigation from 41C to 42S - Kimberly Thompson - 11-13-2013 Bill
Sorry for the delay in responding to your query - most of my responses come from my archives. Every now & then, the source URL is no longer active, so I search for an updated URL w same, but Not always successful. I have over 35 years of archived material in assorted formats (word perfect, DOS text, LOTUS etc..) Still acquiring new material, still enjoying the cross exchange & engagement. |