Mercator Sailing: Course and Distance
08-10-2018, 03:08 AM
Post: #1
 Eddie W. Shore Senior Member Posts: 730 Joined: Dec 2013
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.

Code:
 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;

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
08-10-2018, 11:23 AM
Post: #2
 PedroLeiva Member Posts: 95 Joined: Jun 2014
RE: Mercator Sailing: Course and Distance
(08-10-2018 03:08 AM)Eddie W. Shore Wrote:  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.

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
Very interesting and useful program. Do you think it could be implemented in HP 67 and/or HP 35s?
Pedro
08-12-2018, 05:13 PM
Post: #3
 Dieter Senior Member Posts: 2,134 Joined: Dec 2013
RE: Mercator Sailing: Course and Distance
(08-10-2018 03:08 AM)Eddie W. Shore Wrote:  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

Eddie, I think you confused latitudes and longitudes here. There are no latitudes > 90°.

I also wonder how you get these results. For the given data I get a distance of 159,03 nmi and a course of 61,14° Southwest (241,14° true course). This matches the result of an online calculator where I checked the results.

Finally, what sign convention does your program use? Are West and South positions entered with negative sign?

Dieter
 « Next Oldest | Next Newest »

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