HP 48 Degrees Minutes Seconds, DMS, calculations are made easier with the program described in this Technical Note. Any calculation using (or converting) decimal degree formated or DMS formated numbers may be performed. The operating mode is to perform all calculations on the HP 48 just as you would normally except two results are always displayed. The decimal form and the DMS form. A special menu provides convenient entry of degrees, minutes and seconds. All entries are automaticlly converted to their simplest form.
The highest number the program will display is 360 degrees. If 175 is entered as degrees (DEG) the FIF form will show 175ø 0' and the decimal form will show 175 displayed as you have set your HP 48 display mode. If 360 is entered (displayed) and 1 SEC is "added" the display will show 0ø 0' and 1".
This program is from an EduCALC HP 48 Programming Class assignment. The class was taught by Richard Nelson and Joseph Horn. The program is Joseph's, this description is Richard's. The program structure is also used by the FIF, Feet Inch Fraction, program described in EduCALC Technical Note 60. Create a directory called DMS. Key in the two programs from the listing. One is used to open an environment, the other is used to perform the necessary calculations and display the result at the top of the screen.
To use the program press the DMS directory menu key. Two programs will be in the menus - DK2 and DEG2. DEG2 is used by DK2 and is not run by itself. Press DK2 to open the menu shown below. Note from the display that the program places the machine in user mode. This is a requirement of the vectored ENTER used in the program.
DEG | MIN | SEC | EXIT |
The operation of this environment is to show the number normally on level one of the stack and in labeled DMS form at the top of the display. In this manner you are able to perform any calculations you wish using the menu keys to enter numbers in DMS form and calculating with them in decimal form.
Level one must have a number (zero OK) if you press user menu MIN or SEC. MIN and SEC menu keys cause the entered number to be added to the number on the stack. If there is no number on the stack the machine will error. Press zero, DEG (or ENTER) if zero degrees is the case. Once you enter a number on level one of the stack it will also appear at the top of the screen in DMS form with the Label, DMS: at the top left side of the screen.
The change sign key, +/-, will calculate the compliment of the displayed angle. Enter 179 degrees and press +/-. The display will change to 181 degrees because 360 - 179 = 181. When you are finished with DMS calculations press [EXIT] to return to your DMS directory to see the menu line shown below. Use the order command if they are reversed.
DEG | DK2 | DEG2 |
CORRECTING ERRORS : Error correction is accomplished by entering the number that was entered incorrectly and pressing the +/-, NEG, key. This makes the value negative which when entered again will subtract the error number from the Level one value.
EXAMPLE PROBLEMS (Use FIX two display mode.)
Press | L1 | DMS | Remarks |
DMS, DK2 | - | - | Opens DMS environment |
DEL | USER | CLEARs stack | |
225, DEG or ENTER | 225.00 | 225ø 0' | Degrees of number |
55, MIN | 225.92 | 225ø 55' | Adds minutes |
39, SEC | 225.93 | 225ø 55' 39" | Adds seconds |
3, ö | 75.31 | 75ø 18' 31" | Divide by three |
SIN | 0.97 | 0ø 58' 2.31" | DMS is meaningless |
The last operation, SIN 75.31 degrees, gives a correct answer - 0.97. Change the display mode to STD to see 0.967308338753. The expression of this decimal number in DMS form has no meaning.
The DMS environment may be used for HMS, hours minutes seconds, calculations as long as the number of hours doesn't exceed 360.
1. Commercial 1 - 30 seconds 2. Commercial 2 - 60 seconds 3. Announcer Introduction - 3 Minutes 48 seconds 4. Music - 12 Minutes 42 seconds 5. Commercial 3 - 55 seconds 6. public service spot - 1 Minutes 18 seconds 7. Music - 15 Minutes 27 seconds 8. Commercial 4 - 55 seconds 9. Commercial 5 - 1 Minutes 15 seconds 10. Commercial 6 - 1 Minutes 30 seconds 11. Commercial 7 - 47 seconds 12. Nature program - 15 Minutes 0 seconds 13. Commercial 8 - 45 seconds 14. News - 2 Minutes 37 seconds
The times must be added. Ginny knows that dealing with time is error prone because of the base 60 arithmetic. She can't help, however, to recognize that the first two times are 1.5 minutes. Using her HP 48 and DMS program she knows she can save time and keystrokes if she enters the first two commercial times as 1.5 minutes. Here are the keys she pressed.
Press | L1: | FIF | Remarks |
DMS, DK2 | - | - | Opens FIF environment |
DEL | USER | CLEARs stack | |
0, DEG or ENTER | 0.00 | 0° 0" | Initial value° |
1.5, MIN | 0.03 | 0° 1' 30" | Com. 1 & 2 time |
3, MIN | 0.08 | 0° 4' 30" | Intro. minutes |
48, SEC | 0.09 | 0° 5' 18" | Intro seconds |
12, MIN | 0.29 | 0° 17'18" | Music minutes |
42, SEC | 0.30 | 0° 18' | Music seconds |
55, SEC | 0.32 | 0° 18' 55" | Com. 3 seconds |
1, MIN | 0.33 | 0° 19' 55" | Pub. Serv. minutes |
18, SEC | 0.34 | 0° 20' 13" | Pub. Serv. seconds |
15, MIN | 0.59 | 0° 35' 13" | Music minutes |
27, SEC | 0.59 | 0° 35' 40" | Music seconds |
55, SEC | 0.61 | 0° 36' 35" | Com. 4 seconds |
1.25, MIN | 0.63 | 0° 37' 50" | Com. 5 minutes/seconds |
1.5, MIN | 0.66 | 0° 39' 20" | Com. 6 minutes/seconds |
47, SEC | 0.67 | 0° 40' 7" | Com. 7 seconds |
15, MIN | 0.92 | 0° 55' 7" | Nature prog. minutes |
45, SEC | 0.93 | 0° 55' 52" | Com. 8 seconds |
2, MIN | 0.96 | 0° 57' 52" | News minutes |
37, SEC | 0.97 | 0° 58' 29" | News seconds |
Indeed, the times are OK and this time slot is well planned.
Key the programs as listed. Use alpha mode and spell out the commands if you are not familar with their menu locations. The Advanced User's Reference Manual is a must for looking up these commands. One part of DEG2 is confusing. The eighth line ends with: SWAP + """ . The three double quotes, """, cannot be entered by pressing the quotes key. This is a special case of a string object with a quote inside. If there is an odd number of quotes in a program the machine will attempt to place a missing quote to make it complete. Usually this makes a mess of the program. In order to enter a quote within a string object (a special case because the quote defines the string object) it must be entered as a counted string. To enter, """, use C$ 1 ". Note the space between the $ and 1 and another space between the 1 and the " (quote). Always verify correct program entry with the byte count and check sum given with the program. If you have checked it twice and can't find the error have someone else look at it. More than twice is a waste of your time becuse you are human and are temporarily "blind" to the error.
Program Listings The programs are printed on the 82240B IR printer and enlarged. The byte counts and check sums are included in the data following the listing. If you use HMS most of the time change "DEG" at the beginning of DK2 to "HMS". Also change your directory name.
REV A 960402