Post Reply 
Mercator Sailing: Course and Distance
08-10-2018, 03:08 AM
Post: #1
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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Mercator Sailing: Course and Distance - Eddie W. Shore - 08-10-2018 03:08 AM



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