Mercator Sailing: Course and Distance
09-22-2018, 11:39 PM
Post: #24
 Eddie W. Shore Senior Member Posts: 1,578 Joined: Dec 2013
RE: Mercator Sailing: Course and Distance
(08-24-2018 07:21 PM)Gene222 Wrote:  Two weeks and no response. I guess Eddie is not following his own post.

I bought Calculator Afloat in the late 80s or early 90s to learn more about geodetic calculations. It's a good book, but it does not go into much detail about the signage for the latitude and longitude calculations. You perform the calculations first then mentally apply the proper signage to the results.

I modified Eddie's program where South latitudes and West longitudes must be entered as negative numbers in degrees, but I ran into a problem when the two points have the same latitude, such as

Lat 40 N, Long 25 W
Lat 40 N, Long 30 W

In this case, the course and distance equations give division by zero error messages. How do you calculate the course and distance on a parallel?

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 in degrees, +N, -S", "Longitude 1 in degrees, +E, -W", "Latitude 2 in degrees, +N, -S", "Longitude 2 in degrees, +E, -W"}); 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,DLo,l,θ; DLo:=(λ2-λ1)*60; //difference in longitude in minutes m:=(M2-M1);      //difference in meridional parts in minutes θ:=ATAN(DLo/m);  //course in degrees relative to North (+ or -) or South (+ or -) l:=(L2-L1)*60;   //difference in latitude in minutes IF DLo>=0 AND m>=0 THEN   C:=θ; END; IF DLo<0 AND m>=0 THEN    C:=360+θ;  END; IF DLo<0 AND m<0 THEN   C:= 180+θ; END; IF DLo>=0 AND m<0 THEN   C:=180+θ; END; D:=ABS(l/COS(θ)); RETURN {C,D}; END;

My apologizes for not following subscribing to the program posts I put up; something I will do from now on. I appreciate all the comments and modifications.

Eddie
 « 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 - VadimV - 12-21-2022, 08:31 PM 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: 2 Guest(s)