Showing posts with label sailing. Show all posts
Showing posts with label sailing. Show all posts

Sunday, November 26, 2023

DM42/HP 42S: Most Probable Position

DM42/HP 42S:  Most Probable Position



Introduction


The program MPP calculates an adjusted latitude (+N, -S) and adjusted longitude (+W, -E) of an observer:  


*  The latitude and longitude of the observer's dead reckoning.  

*  The computed altitude and azimuth (N = 0°, E = 90°, S = 180°, W = 270°).

*  The height of the sextant held by the observer.  


The most probable position is calculated by:


Calculated latitude:


LAT* = L - (Hc - H0) × cos(Z)


Calculated longitude:  


LON* = λ - ( (H0 - Hc) × sin(Z) ÷ cos(L) )


where


L =  dead reckoning latitude 

λ =  dead reckoning longitude

Hc = computed altitude of the celestial object

Z = zenith of the celestial object

H0 = correct sextant height


L, λ, Hc, H0 are customarily entered in degrees-minutes or degrees-minutes-seconds format.   The program MPP requires the four variables to be entered in L, λ, Hc, and H0 to be entered in DDMM.m format (see the Instructions section).  



Instructions


Soft menu items are enclosed in parenthesis.


1.  Enter the longitude and latitude in DDMM.m format.   DD represents decimal degrees, MM represents the integer part of minutes, and .m represents the fractional part of minutes.  


Examples:


Enter 52°00'  as 5200.


Enter 17°16.56' as  1716.56.


Enter the longitude, press [ENTER], enter the latitude, then press (LA/LO).   North longitude is positive, west latitude is positive.


2.  Enter the altitude of the reference object (star, planet, sun, other celestial object) in DDMM.m format, press [ENTER], the object's zenith in degrees, then press (HC/Z).  


3.  Enter the correct sextant height in DDMM.m format, press (>H0).  The altitude intercept (Hc - H0) is displayed in miles.  (negative is towards, positive is away)


4.  Press (CALC) to get the computed latitude (LAT*), press [ R/S ] to get the computed longitude (LNG*).  


To exit the program, press (EXIT).  



DM42/HP 42S/Free42/Plus Code:  Most Probable Position


00 { 234-Byte Prgm }

01▸LBL "MPP"

02 DEG

03 "MOST PROBABLE"

04 AVIEW

05 PSE

06 "POSITION, HP 65"

07 AVIEW

08 PSE

09 "DDMM.m, +N, +W"

10 AVIEW

11 PSE

12▸LBL 30

13 "LA/LO"

14 KEY 1 XEQ 21

15 "HC/Z"

16 KEY 2 XEQ 22

17 ">H0"

18 KEY 3 XEQ 23

19 "CALC"

20 KEY 4 XEQ 24

21 "EXIT"

22 KEY 6 XEQ 26

23 MENU

24▸LBL 00

25 STOP

26 GTO 00

27▸LBL 21

28 XEQ 31

29 STO 07

30 X<>Y

31 XEQ 31

32 STO 02

33 GTO 30

34▸LBL 22

35 STO 05

36 X<>Y

37 XEQ 31

38 STO 04

39 GTO 30

40▸LBL 23

41 XEQ 31

42 STO 06

43 RCL 04

44 X<>Y

45 -

46 STO 01

47 XEQ 32

48 GTO 30

49▸LBL 31

50 →HMS

51 100

52 ÷

53 →HR

54 RTN

55▸LBL 32

56 →HMS

57 100

58 ×

59 →HR

60 RTN

61▸LBL 24

62 RCL 02

63 RCL 05

64 COS

65 RCL× 01

66 -

67 STO 03

68 XEQ 32

69 "LAT*="

70 ARCL ST X

71 AVIEW

72 STOP

73 RCL 07

74 RCL 05

75 SIN

76 RCL× 01

77 RCL 02

78 COS

79 ÷

80 +

81 1

82 →REC

83 →POL

84 X<>Y

85 STO 08

86 XEQ 32

87 "LNG*="

88 ARCL ST X

89 AVIEW

90 PSE

91 GTO 30

92▸LBL 26

93 CLMENU

94 EXITALL

95 .END.



Download mpp.raw:  

https://drive.google.com/file/d/1Jrs14guVv3wuYEMuFRYDq4N3MGHrICxL/view?usp=sharing 



Example


Data Given:

Latitude:  30°44' N

Longitude:  128°36' W

Computed Altitude of star:  21°40'

Azimuth of the star:  61°

Corrected Sextant:  19°32'


Enter:

3044 ENTER 12836 (LA/LO)

2140 ENTER 61 (HC/Z)

1932 (>H0)   


(CALC)  

LAT*=2941.57  (29°41.57' N)

LNG*=13046.25  (130°46.25' W)



Source


Hewlett Packard.  "NAV 1-20A:  MOST PROBABLE POSITION"  HP-65 Navigation Pac 1 1974.  pp. 64-65, 137




Eddie


All original content copyright, © 2011-2023.  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. 


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. 


Thursday, August 9, 2018

HP Prime and TI-84 Plus CE: Mercator Sailing Course and Distance

HP Prime and TI-84 Plus CE: Mercator Sailing Course and Distance

Introduction

The following program MERCATOR calculates the course direction and distance in miles given two pairs of latitude (north/south) and longitude (east/west).  Conversion to arc minutes will be required during calculation.

Formulas Used:

Course:

C = atan ( | λ2 – λ1 | * 60 / | M2 – M1 | )
Where:
M1 = 7915.7045 * log ( tan (45° + L1 / 2 ) ) – 23.2689 * sin L1
M2 = 7915.7045 * log ( tan (45° + L2 / 2 ) ) – 23.2689 * sin L2

Direction:


D = | L2 – L1 | * 60 / cos C

HP Prime MERCATOR

EXPORT MERCATOR()
BEGIN
// EWS 2018-08-10
// The Calculator Afloat

HAngle:=1; // degrees
LOCAL L1,L2,λ1,λ2,M1,M2;
LOCAL C,D;

INPUT({L1,λ1,L2,λ2},"Mercator",
{"L1:","λ1:","L2:","λ2:"},
{"Latitude 1",
"Longitude 1",
"Latitude 2",
"Longitude 2"});

M1:=7915.7045*LOG(TAN(45+L1/2))
-23.2689*SIN(L1);
M2:=7915.7045*LOG(TAN(45+L2/2))
-23.2689*SIN(L2);

LOCAL M;
C:=ABS(λ1-λ2)*60;
M:=ABS(M2-M1);
C:=ATAN(C/M);

D:=ABS(L2-L1)*60/COS(C);

RETURN {C,D};

END;

TI-84 Plus CE Program MERCATOR

Degree
Input "LATITUDE 1:",A
Input "LONGITUDE 1:",B
Input "LATITUDE 2:",C
Input "LONGITUDE 2:",D
7915.7045*log(tan(45+A/2))-23.2689*sin(A)→E
7915.7045*log(tan(45+C/2))-23.2689*sin(C)→F
abs(D-B)*60→R
abs(F-E)→M
tan^-1(R/M)→R
abs(C-A)*60/cos(R)→S
Disp "COURSE:",R,"DISTANCE:",S

Example

Latitude 1:  102° 54’ 16” W = 102.9044444444°
Longitude 1: 43° 21’ 16” N = 43.3544444444°
Latitude 2:  106° 3’ 8” W = 106.0522222222°
Longitude 2: 42° 4’ 30” N = 42.075°

Results:

Course:  5.782390957°

Distance:  189.832588 mi

Source: 

Henry H. Shufeldt and Kenneth E. Newcomer  The Calculator Afloat: A Mariner’s Guide to the Electronic Calculator Naval Institute Press:  Annapolis, Maryland.  1980


I will be taking a few weeks off this August, it will be part vacation, part math research.  I plan to come back during the week of 8/20/2018.  I may have one more post before the break, especially if a calculator I ordered comes in time for a review.  Anyway, stay safe, sane, and for those of you in the Northern Hemisphere, cool.  Weather wise, this summer has been bonkers.

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle i...