Sunday, January 31, 2021

HP 42S/DM42 and TI-85: True Bearing vs. Compass Bearing

 HP 42S/DM42 and TI-85:  True Bearing vs. Compass Bearing


Introduction 





The program converts angles between true bearing and compass bearing.


True Bearing:  0° to 360°, going clockwise from due north.  North is typically represented as the positive y direction.  True bearing is also known as azimuth.


Compass Bearing:  The grid is divided into four quadrants, each given one direction.  Measurements from each quadrant range from 0° to 90°.


Northeast (NE):  the angle is measured from true north (positive y axis), clockwise

Southeast (SE):  the angle is measured from true south (negative y axis), counterclockwise

Southwest (SW): the angle is measured from true south (negative y axis), clockwise

Northwest (NW): the angle is measured from true north (positive y axis), counterclockwise


HP 42S/DM42 Program:  CNVANG 


00 { 263-Byte Prgm }

01▸LBL "CNVANG"

02 DEG

03 "∡?"

04 PROMPT

05 STO 00

06 "∡ CONVERSION"

07 AVIEW

08 ">COMP"

09 KEY 1 GTO 01

10 "NE>"

11 KEY 2 GTO 06

12 "SE>"

13 KEY 3 GTO 03

14 "SW>"

15 KEY 4 GTO 04

16 "NW>"

17 KEY 5 GTO 05

18 MENU

19▸LBL 00

20 STOP

21 GTO 00

22▸LBL 01

23 CLA

24 360

25 MOD

26 ENTER

27 ENTER

28 90

29 MOD

30 STO 00

31 X<>Y

32 90

33 ÷

34 IP

35 STO 01

36 0

37 X=Y?

38 GTO 07

39 R↓

40 1

41 X=Y?

42 GTO 08

43 R↓

44 2

45 X=Y?

46 GTO 09

47 GTO 10

48▸LBL 07

49 RCL 00

50 ARCL ST X

51 32

52 XTOA

53 78

54 XTOA

55 69

56 XTOA

57 GTO 01

58▸LBL 08

59 90

60 RCL- 00

61 STO 00

62 ARCL ST X

63 32

64 XTOA

65 83

66 XTOA

67 69

68 XTOA

69 GTO 01

70▸LBL 09

71 RCL 00

72 ARCL ST X

73 32

74 XTOA

75 83

76 XTOA

77 87

78 XTOA

79 GTO 01

80▸LBL 10

81 90

82 RCL- 00

83 STO 00

84 ARCL ST X

85 32

86 XTOA

87 78

88 XTOA

89 87

90 XTOA

91 GTO 01

92▸LBL 01

93 BEEP

94 AVIEW

95 GTO 11

96▸LBL 03

97 180

98 X<>Y

99 -

100 GTO 06

101▸LBL 04

102 180

103 +

104 GTO 06

105▸LBL 05

106 360

107 X<>Y

108 -

109 GTO 06

110▸LBL 06

111 STO 00

112 BEEP

113 CLA

114 "TRUE="

115 ARCL ST X

116▸LBL 11

117 CLMENU

118 EXITALL

119 RTN

120 .END.


TI-85 Program: CONVANG


ClLCD

"2020-12-31 EWS"

Degree

Input "θ? ",A

Menu(1,">COMP",A1,2,"NE>",A2,3,"SE>",A3,4,"SW>,A4,5,"NW>",A5)

Lbl A1

mod(mod(A,360),90)→B

iPart(A/90)→C

If C==0

Then

Outpt(3,1,B)

Outpt(3,17,"° NE ")

End

If C==1

Then

90-B→B

Outpt(3,1,B)

Outpt(3,17,"° SE ")

End

If C==2

Then

Outpt(3,1,B)

Outpt(3,17,"° SW ")

End

If C==3

Then

90-B→B

Outpt(3,1,B)

Outpt(3,17,"° NW ")

End

Lbl A2

A→B

Goto A6

Lbl A3

180-A→B

Goto A6

Lbl A4

180+A→B

Goto A6

Lbl A5

360-A→B

Goto A6

Lbl A6

Outpt(3,1,"TRUE= ")

Outpt(3,7,B)

Stop


Examples


To True Bearing:

35 NE> returns 35

74 SE> returns 106

20 SW> returns 200

76 NW> returns 284


From True Bearing:

35 >COMP returns 35 NE

106 >COMP returns 74 SE

200 >COMP returns 20 SW

284 >COMP returns 76 NW


Coming up in February:  a review of the TI-36 XII calculator, more programs for an old favorite, the TI-85, and much more.


Here's to the Groundhog delivering great news on 2/2/2021,


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


TI 30Xa Algorithm: Acceleration, Velocity, Speed

TI 30Xa Algorithm: Acceleration, Velocity, Speed Introduction and Algorithm Given the acceleration (α), initial velocity (v0), and...