This is the code listing for a wind correction program, which is very useful when performing flight calculations. I wrote this for the HP 15C and HP 33s RPN calculators, however, it will likely work on other RPN models as well.
HP 33s HP 15C ------ ------ F0001 LBL F 001 42,21,11 LBL A F0002 x<>y 002 34 x<>y F0003 R(UP) 003 43 33 R(UP) F0004 - 004 30 - F0005 ENTER 005 36 ENTER F0006 SIN 006 23 SIN F0007 +/- 007 16 CHS F0008 R(UP) 008 43 33 R(UP) F0009 * 009 20 * F0010 R(UP) 010 43 33 R(UP) F0011 LAST x 011 43 36 LST x F0012 R(DN) 012 33 R(DN) F0013 / 013 10 / F0014 LAST x 014 43 36 LST x F0015 R(DN) 015 33 R(DN) F0016 ASIN 016 43 23 SIN^-1 F0017 R(DN) 017 33 R(DN) F0018 COS 018 24 COS F0019 * 019 20 * F0020 R(DN) 020 33 R(DN) F0021 x<>y 021 34 x<>y F0022 COS 022 24 COS F0023 * 023 20 * F0024 R(UP) 024 43 33 R(UP) F0025 - 025 30 - F0026 RTN 026 43 32 RTN CK=34B9 LN=78
The program takes the arguments from the following registers:
X: True Airspeed Y: True Course Z: Wind Speed T: Wind Direction
and outputs the following:
X: Ground Speed Y: Wind Correction Angle
Example: Your true course is 240 degrees and your true airspeed is 110 knots. The wind is 182@17.
Ensure that your calculator is in DEG mode (15C: 43 7 DEG; 33s: MODES 1).
Use the following key sequence to compute the wind correction angle and ground speed on the 15C:
182 ENTER 17 ENTER 240 ENTER 110 GSB A
The ground speed is displayed in X (100.0425). Pressing x<>y will show the wind correction angle in Y (-7.5309). You may want to add an x<>y (34) instruction at the end of the 15C code for reverse output (as is more convenient for filling out navigation logs). Adding a PSE (42 31) instruction after line 16 is also convenient for this purpose.
Use the following key sequence to compute the wind correction angle and ground speed on the 33s:
182 ENTER 17 ENTER 240 ENTER 110 XEQ F
The ground speed is displayed in X (100.0425) and the wind correction angle is displayed in Y (-7.5309).
This program implements the following equations, which were obtained by simply sketching out the vectors and using some basic trigonometry to obtain the desired angles and lengths.
WCA = asin(ws * -sin(th - wd) / ts)
GS = ts * cos(WCA) - ws * cos(th - wd)
Last update: 2007-01-15