Mercator Sailing: Course and Distance
08-10-2018, 03:08 AM
Post: #1
 Eddie W. Shore Senior Member Posts: 1,360 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
 « Next Oldest | Next Newest »

 Messages In This Thread Mercator Sailing: Course and Distance - Eddie W. Shore - 08-10-2018 03:08 AM RE: Mercator Sailing: Course and Distance - PedroLeiva - 08-10-2018, 11:23 AM RE: Mercator Sailing: Course and Distance - Dieter - 08-12-2018, 05:13 PM RE: Mercator Sailing: Course and Distance - Eddie W. Shore - 09-22-2018, 11:37 PM RE: Mercator Sailing: Course and Distance - Gene222 - 08-24-2018, 07:21 PM RE: Mercator Sailing: Course and Distance - Dieter - 08-25-2018, 06:08 AM RE: Mercator Sailing: Course and Distance - Eddie W. Shore - 09-22-2018, 11:39 PM RE: Mercator Sailing: Course and Distance - Gene222 - 08-26-2018, 12:30 AM RE: Mercator Sailing: Course and Distance - Dieter - 08-26-2018, 07:18 AM RE: Mercator Sailing: Course and Distance - Albert Chan - 09-10-2022, 03:17 PM RE: Mercator Sailing: Course and Distance - Gene222 - 08-28-2018, 12:46 AM RE: Mercator Sailing: Course and Distance - Dieter - 08-28-2018, 08:53 AM RE: Mercator Sailing: Course and Distance - Dieter - 08-28-2018, 04:49 PM RE: Mercator Sailing: Course and Distance - Gene222 - 08-29-2018, 09:02 PM RE: Mercator Sailing: Course and Distance - Dieter - 08-30-2018, 05:49 AM RE: Mercator Sailing: Course and Distance - Gene222 - 08-30-2018, 11:59 PM RE: Mercator Sailing: Course and Distance - Gene222 - 08-31-2018, 02:15 AM RE: Mercator Sailing: Course and Distance - Dieter - 08-31-2018, 05:46 AM RE: Mercator Sailing: Course and Distance - Dieter - 09-01-2018, 05:51 AM RE: Mercator Sailing: Course and Distance - Gene222 - 09-01-2018, 02:52 AM RE: Mercator Sailing: Course and Distance - Gene222 - 09-02-2018, 04:03 PM RE: Mercator Sailing: Course and Distance - Dieter - 09-02-2018, 06:27 PM RE: Mercator Sailing: Course and Distance - Gene222 - 09-03-2018, 10:10 PM RE: Mercator Sailing: Course and Distance - Dieter - 09-04-2018, 07:19 PM RE: Mercator Sailing: Course and Distance - Gene222 - 09-05-2018, 05:46 PM

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