Post Reply 
(42S) Easy Transverse
07-10-2016, 02:03 AM (This post was last modified: 06-15-2017 01:16 PM by Gene.)
Post: #1
(42S) Easy Transverse
HP 42S: Easy Transverse

Calculates the new point knowing the original coordinates, direction, and angle of travel. The angle 0° comes from due east and rotates counterclockwise. The program sets the HP 42S to degrees mode. We make use of the Programmable Menu.

Code:
00 {183-Byte Prgm}
01 LBL “EASYTRV”
02 DEG 
03 0
04 STO “T”   \\ initialize total distance counter
05 “INITIAL EASTING”
06 PROMPT
07 STO “E”
08 “INIT. NORTHING”
09 PROMPT
10 STO “N”
11 LBL 00 \\ main label
12 XEQ 01 \\ go to calculation sub loop
13 LBL 03 \\ start menu label
14 CLMENU
15 “NEXT”
16 KEY 1 XEQ 01 \\ KEYX command
17 “QUIT”
18 KEY 2 GTO 02 \\ KEYG command
19 MENU
20 STOP
21 GTO 03 \\ end menu loop
22 LBL 01 \\ main calculation loop
23 CLRMENU \\ make both lines available for viewing
24 “ANGLE (0°-360°)”
25 PROMPT
26 STO “A”
27 “DISTANCE”
28 PROMPT
29 STO “D”
30 STO+ “T”
31 →REC
32 STO+ “E”
33 X<>Y
34 STO+ “N”
35 RCL “E”
36 “EAST:”
37 ARCL ST X
38 AVIEW
39 STOP
40 RCL “N”
41 “NORTH:”
42 ARCL ST X
43 AVIEW
44 RTN
45 LBL 2  \\ finalization sub routine
46 CLMENU
47 RCL “T”
48 “ΣDIST:”   \\  Σ is from the ALPHA-MATH menu
49 ARCL ST X
50 AVIEW
51 STOP
52 RCL “N”
53 RCL “E”
54 END

Test:
Initial Data Coordinates: N = 1,000, E = 1,000
Travel #1: 170 units at 118° (28° NW)
Travel #2: 162 units at 45° (45° NE)

Input:
[XEQ] {EASYT}
1000 [R/S] [R/S]
118 [R/S] 170 [R/S]

Result:
EAST: 920.1898 [R/S], NORTH: 1,150.1011

{NEXT} 45 [R/S] 162 [R/S]

EAST: 935.5061 [R/S], NORTH: 1,192.4143

{QUIT} ΣDIST: 215 [R/S], N on Y stack, E on X stack.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)