[net.travel] Distance from latitude and longitude

ntt@dciem.UUCP (Mark Brader) (11/02/83)

This may be old stuff to those who studied spherical trigonometry, but
I've never seen it in print, and it's easy to use if your calculator
has the standard trig functions.

Suppose there are two places with latitudes Y and y, and longitudes X and x.
(Use opposite signs for opposite hemispheres... North Americans would use +
for north latitude and west longitude, - for south and east.)  Now let R be
the radius of the earth (see note below).  Then the distance D between the
two places (along a great circle, of course) is given by:

	D := R * arccos (cos(y)*cos(Y)*cos(X-x) + sin(y)*sin(Y));

where arccos means inverse cosine, of course, **and*is*computed*in*radians**.

For instance, with Toronto at y = 43 deg 39 min N, x = 79 deg 23 min W,
	      and Montreal at Y = 45 deg 31 min N, X = 73 deg 34 min W,
we get D = R arccos (0.9968589); using R = 3957 miles, this gives
D = 3957*0.07928 miles = 313.7 miles.  By railway it is 335 miles, of course.

NOTE: the above formula would be precisely accurate only if the earth was
spherical.  However, it will be close enough for most practical purposes,
if you take an R somewhere near the average value along the route.  A very
good approximation of R as a function of the latitude y is this:

	R := k * sqrt (148.37542 + (cos(y))^2);

where k = 324.2701 miles = 521.8622 km.  This formula assumes that the earth
is ellipsoidal, which is very nearly true.  (The 148.37542 is based on the
eccentricity of the cross-sectional ellipse and is independent of miles-vs-km;
all the constants here are based on the latest estimates in Van Nostrand's
Scientific Encyclopedia, 5th edition, and really have ~5 significant digits.)

For instance, for latitudes of 30, 35, 40, and 45 degrees, this gives R (to
5 significant digits) as 3959.9, 3958.8, 3957.7, 3956.6 miles respectively.

Mark (net.math and net.travel? weird!) Brader, NTT Systems Inc.,
Toronto (coordinates above), Canada

colonel@sunybcs.UUCP (George Sicherman) (11/05/83)

Here's a harder one.  Find the latitude and longitude
of the (spherical) circumcenter of a triangle, given
the latitudes and longitudes of the triangle's vertices.
		G. L. Sicherman
		...seismo!rochester!rocksvax!sunybcs!colonel