MAPS-L Archives

Maps-L: Map Librarians, etc.

MAPS-L@LISTSERV.UGA.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Maps and Air Photo Systems Forum <[log in to unmask]>
Date:
Fri, 2 May 1997 09:12:45 EDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (109 lines)
----------------------------Original message----------------------------
 
SOME NUMERICAL RECIPES FOR CALCULATING DISTANCES:
 
Step 0) Assume you start out with the latitudes and longitudes of two
points expressed in decimal degrees (lat1,lon1),(lat2,lon2).
Longitudes are measured from 0 to 360 east from Greenwich. West
longitudes can be given as negative numbers in the range from
-180 to 0. And, of course, if you have the coordinates in degrees,
minutes, and seconds, you can convert to decimal degrees as follows:
   a) take off the sign,
   b) decimal_degrees = degrees + minutes/60 + seconds/3600,
   c) put the sign back on.
 
--------------------------------------------------------------------
GREAT CIRCLE DISTANCE ON A SPHERICAL EARTH:
 
This is what most people mean by the distance between two points. It
ignores topography and practical issues. It is the shortest distance
between two points on the surface of the Earth under the assumption
that the Earth is a sphere to a good approximation.
 
Step 1) Convert the latitudes to co-latitudes and all angles to radians:
   phi1 = (90-lat1)*pi/180
   phi2 = (90-lat2)*pi/180
   theta = (lon2-lon1)*pi/180
[NOTE: do NOT multiply by pi/180 if you are using a handheld
calculator since they usually let you do trig functions in degrees.
If you're doing calcs in a spreadsheet or programming language,
keep the pi/180].
 
Step 2) Get the standard great circle angular distance in radians:
   a = arccos[cos(phi1)*cos(phi2)+sin(phi1)*sin(phi2)*cos(theta)].
 
[ Many programming languages do not include the arccos function. In
that case, use
   arccos(x) = pi/2 - arctan(x/sqrt(1-x*x)). ]
 
Step 3) Multiply by the radius of the Earth to convert radians to
statute miles:
     d = 3955*a.
 
------------------------------------------------------------------
SHORTCUT FOR POINTS SEPARATED BY LESS THAN ~500 MILES:
 
Any small region of the Earth is more or less a flat plane so if you
want to save some calculational time (and you're not too near the north
or south pole), you can use a simple variant of the Pythagorean
Theorem...
 
Step 1) Convert to radians:
   lat1 = lat1*pi/180
   lat2 = lat2*pi/180
   theta = abs(lon2-lon1)
   if (theta>180) then theta=360-theta
   theta = theta*pi/180
 
Step 2) Get the angular separation in radians using the Pythagorean
Theorem:
   a = sqrt((theta*cos(lat1))^2+(lat2-lat1)^2).
 
Step 3) Convert to miles:
     d = 3955*a.
 
------------------------------------------------------------------
MORE ACCURATE DISTANCE ACCOUNTING FOR THE EARTH'S ELLIPSOIDAL
SHAPE:
 
The Earth is not a sphere. Because of its rotation, it is oblate --
somewhat flattened at the poles. That means that the equation for
"great circle" distance can be off by as much as 0.5%. Using
variational calculus or differential geometry, equations can be
derived which give better values for the shortest possible distance
along the surface of the Earth. The results:
 
Step 0) Use e = 1/298.26 for the flattening of the Earth.
 
Step 1) Convert the latitudes to co-latitudes and all angles to
radians as usual:
   phi1' = pi*(90-lat1)/180
   phi2' = pi*(90-lat2)/180
   theta = pi*(lon2-lon1)/180
 
Step 2) Calculate adjusted colatitudes:
   phi1 = phi1'+(3/4)*e*sin(2*phi1')
   phi2 = phi2'+(3/4)*e*sin(2*phi2')
 
Step 3) Get the standard great circle angular distance:
   a' = arccos[cos(phi1)*cos(phi2)+sin(phi1)*sin(phi2)*cos(theta)]
 
Step 4) Calculate the geodesic distance on the ellipsoid:
   a = a'*[1+(1/2)*e*(sin(phi1)*sin(phi2)*sin(theta)/sin(a'))^2]
 
Step 5) Convert to miles
   D = 3955.5*a.
 
If you skip steps 2 and 4, this is just the great circle distance
on a spherical Earth again. It's important to note that the
distance calculated above is the shortest distance between two
points on the Earth's surface at sea level. It is not properly
a "great circle" distance any more since the geodesics on the
surface of an ellipsoid are not circles. Note that the ellipsoidal
distances are always within 0.5% of the great circle distances,
but that can mean as much as 22 miles. Usually the difference
is less than that: 9 miles and 0.2% are more typical.
 
-Frank E. Reed
http://www.clockwk.com/fer

ATOM RSS1 RSS2