News:

Howdy, Com-Pac'ers!
Hope you'll find the Forum to be both a good resource and
a place to make sailing friends.
Jump on in and have fun, folks! :)
- CaptK, Crewdog Barque, and your friendly CPYOA Moderators

Main Menu

Sight Reduction Program

Started by HenryC, January 09, 2010, 10:33:43 AM

Previous topic - Next topic

HenryC

This program (for the Casio fx-7000G programmable graphics calculator) does the sight reduction calculation using the math in the Nautical Almanac (see previous posts).  It's pretty compact code because the Casio only had memory for 26 named variables, one for each letter of the alphabet. This device is now a collector's item, (25 years old!) but the code is easy to read so I have included it here. I have the same code written in RPL as a callable subroutine for HP 28/48 calculators, and I will provide it  for anyone who asks for it.  Unless you program HPs all the time, RPL is impenetrable.


                  "SEXTANT"? => O                           Input Prompts 
                  "GHA"? => G
                  "DEC"? => D
                  "LAT"? => T
                  "LON"? => N   

                  "LHA"                                              Calculate and
                   G+N => L>                                     Output Local Hour Angle

                  "N2PI"? => C                                  Prompt for multiple of 360
                   L+C => L                                       Correct the LHA

                  sinD => S                                        Altitude Calculation
                  cosDxcosL => C 
                  SxsinT => X
                  CxcosT => Y
                  sin-1(X+Y) => H       

                  SxcosT => X                                    Azimuth Calculation         
                  CxsinT => Y               
                  (X-Y)/cosH => X                         
                  If X>1 then 1 => X                                       
                  If X<-1 then -1 => X
                  cos-1(X) => A             
                  (360-A) =>  Z             
                  If  L>180 then A => Z

                  "INTERCEPT"                                    Calculate and Output Intercept                                 
                  (O-H)x60 => I>                                 (Positive towards, negative away)
                                                       
                  "AZIMUTH"
                  Z>                                                    Output Azimuth     

HenryC

I just sent you a message responding to your question.  Let me know if you don't receive it.
HenryC