| Uh, did you remember when you suggested lattitude and longitude that
the world is more or less round?
The little "squares" made by the intersections get bigger as you
approach the equator and smaller as you approach the poles.
Sure, there's a formula for it somewhere, but don't you think there's
probably a simpler method?
FWIW
John H-C
P.S. The formula would only be for approximations, anyway, since the
globe is not really a globe (in geometric terms).
|
| Presuming that your friend already has factored the shape of the earth
into the equation, the place to look is: Dutton's Navigation & Piloting
by Elbert S. Maloney.
Reference the chapter on "The Sailings" which is the term used to refer
collectively to various mathematical methods of solving problems
involving course, distance, difference of latitude, difference of
longitude, and departure.
Dutton also refers the reader to Bowditch for a more detailed
discussion of the derivations of these equations.
JR
|
| There are a number of standard spherical trigonometry equations and
methods to calculate the distance between two locations specified by
their latitude and longitude. These are given in almost all celestial
navigation textbooks and in Bowditch. If you understand FORTRAN, read
on. The equations assume a perfectly spherical earth, which is good
enough for most purposes. The difference between the great circle
distance and the distance from a Mercator chart is small for locations
close together. For locations far apart, the difference is significant,
which is why ships and aircraft on long passages follow great circle
routes.
Alan
================================================================================
<<< UNIFIX::$1$DUA14:[NOTES$LIBRARY]SAILING.NOTE;1 >>>
-< SAILING >-
================================================================================
Note 513.1 Distance from Lat/Long 1 of 5
PULSAR::BERENS "Alan Berens" 92 lines 24-MAR-1987 17:28
-< an answer in FORTRAN >-
--------------------------------------------------------------------------------
C GCIRCLE: Great Circle Navigation January 1982
C
C This program calculates the great circle distance between
C a place of departure and a destination. It also calculates
C the initial course for sailing the great circle. It is based
C on the method and equations in Budlong.
C
REAL*8 DEG,DIST,HC,LAT,LATD,LONG,LONGD,M,MA,MIN,PI,X,Y,Z
C
TYPE 5
5 FORMAT (1X)
C
C Enter departure latitude in degrees and minutes
C
30 TYPE 95
95 FORMAT (1X,'DEPARTURE LATITUDE ',$)
ACCEPT *, DEG, MIN
LAT=DEG+MIN/60.0D00
C
C Enter departure longitude (assumed west) in degrees and minutes
C
TYPE 90
90 FORMAT (1X,'DEPARTURE LONGITUDE ',$)
ACCEPT *, DEG, MIN
LONG=DEG+MIN/60.0D00
TYPE 5
C
C Enter destination latitude in degrees and minutes
C
TYPE 10
10 FORMAT (1X,'DESTINATION LATITUDE ',$)
ACCEPT *, DEG, MIN
LATD=DEG+MIN/60.0D00
C
C Enter destination longitude in degrees and minutes
C
TYPE 20
20 FORMAT (1X,'DESTINATION LONGITUDE ',$)
ACCEPT *, DEG, MIN
LONGD=DEG+MIN/60.0D00
TYPE 5
C
C Find meridian angle (MA)
C If (MA .LE. 0) then course between 0 and 180
C
MA=LONG-LONGD
C
C Convert degrees to radians
C
PI=3.141592653589793D00
LAT=LAT*PI/180.0D00
LATD=LATD*PI/180.0D00
M=MA*PI/180.0D00
C
C Hc computation
C
X=SIN(LAT)*SIN(LATD)
Y=COS(LAT)*COS(LATD)*COS(M)
HC=ASIN(X+Y)
C
C Great circle distance computation
C
HC=HC*180.0D00/PI
DIST=(90.0D00-HC)*60.0D00
C
C Z computation
C
X=COS(LAT)*TAN(LATD)
Y=SIN(LAT)*COS(M)
Z=ATAN(SIN(M)/(X-Y))
Z=Z*180.0D00/PI
C
C Determine actual course -- necessary because of
C implementation of ATAN
C
IF (MA .EQ. 0.0 .AND. LATD .GT. LAT) Z=0.0D00
IF (MA .EQ. 0.0 .AND. LATD .LT. LAT) Z=180.0D00
IF (MA .GT. 0.0 .AND. Z .GE. 0.0) Z=Z
IF (MA .GT. 0.0 .AND. Z .LT. 0.0) Z=Z+180.0D00
IF (MA .LT. 0.0 .AND. Z .GE. 0.0) Z=Z+180.0D00
IF (MA .LT. 0.0 .AND. Z .LT. 0.0) Z=Z+360.0D00
C
C Results
C
TYPE *, 'DISTANCE ',DIST,'NM'
TYPE *, 'COURSE ',Z,'DEGREES'
TYPE 5
TYPE 5
TYPE 5
GOTO 30
END
|