Calculating Miles per Degree Longitude - Check my Math Please

J

Joseph Geretz

I need to calculate miles per degree longitude, which obviously depends on
latitude since lines of longitude converge at the poles. Via Google, I've
come up with the following calculation:

private const double MilesPerDegLat = 69.04;
private const double EarthRadiusMiles = 3963.1676;
private static double PiDiv180 = Math.PI / 180;

double MilesPerDegLon = MilesPerDegLat * Math.Cos(Latitude * PiDiv180)

I'm not fluent at all in the trigonometric branches of mathematics and I'd
appreciate it if you could check my math for me.

I basically got this from:

http://answers.google.com/answers/threadview?id=577262

I'm using the formula which Steven expressed as: 69.1703234283616 *
COS(Lat*0.0174532925199433) with just one difference. I am using the value
69.06 for miles per degree latitude. Steven is using 69.17. I understand
that the Earth is not a perfect sphere and I'm under the impression that the
value 69.06 is the correct average to use. On the other hand, my
calculations will be exclusively confined to North America. Should I be
using a value of 69.17?

I'm also curious about how this formula works without taking into account
the Earth's radius. Again, I'm not fluent by any means in trigonometry, but
I'd been assuming that the Earth's radius would play a role in the
calculation. Also, I'm curious as to why the formula proposed directly prior
to the final solution doesn't work:

(pi/180) * R * cosA where R is the radius of the earth in miles and A is the
degree latitude.

For some reason this didn't work for me, but perhaps I encoded it
incorrectly. If this should work and is deemed to be more precise than the
claculation I've implemented I'll happily substitute it.

Thanks for your help!

- Joseph Geretz -
 
M

Michael A. Covington

Assuming you are describing only movement eastward or westward, that looks
right. The cosine of the latitude is the crucial factor.
 
H

Hans Kesting

I need to calculate miles per degree longitude, which obviously
depends on latitude since lines of longitude converge at the poles.
Via Google, I've come up with the following calculation:

private const double MilesPerDegLat = 69.04; private const double
EarthRadiusMiles = 3963.1676; private static double PiDiv180 = Math.PI
/ 180;

double MilesPerDegLon = MilesPerDegLat * Math.Cos(Latitude * PiDiv180)

I'm not fluent at all in the trigonometric branches of mathematics and
I'd appreciate it if you could check my math for me.

I basically got this from:

http://answers.google.com/answers/threadview?id=577262

I'm using the formula which Steven expressed as: 69.1703234283616 *
COS(Lat*0.0174532925199433) with just one difference. I am using the
value 69.06 for miles per degree latitude. Steven is using 69.17. I
understand that the Earth is not a perfect sphere and I'm under the
impression that the value 69.06 is the correct average to use. On the
other hand, my calculations will be exclusively confined to North
America. Should I be using a value of 69.17?

I'm also curious about how this formula works without taking into
account the Earth's radius. Again, I'm not fluent by any means in
trigonometry, but I'd been assuming that the Earth's radius would play
a role in the calculation. Also, I'm curious as to why the formula
proposed directly prior to the final solution doesn't work:

(pi/180) * R * cosA where R is the radius of the earth in miles and A
is the degree latitude.

For some reason this didn't work for me, but perhaps I encoded it
incorrectly. If this should work and is deemed to be more precise than
the claculation I've implemented I'll happily substitute it.

Thanks for your help!

- Joseph Geretz -


If you start from your EarthRadiusMiles and multiply by 2*PI, you get the
circumference.
Divide by 360 (degrees) and you get 69,1703.. miles per degree.
(so the earth radius is a hidden part of that MilesPerDegLat number)

Hans Kesting
 
J

Joseph Geretz

(so the earth radius is a hidden part of that MilesPerDegLat number)

Ah, I see. (Kind of - I don't pretend to completely understand the
mathematics, but I can see how the radius can be derived from miles per
degree latitdute.)

Thank you!

Joseph Geretz
 
J

Joseph Geretz

Hi Michael,
Assuming you are describing only movement eastward or westward, that looks
right. The cosine of the latitude is the crucial factor.

Yes, the movement is due east / west.

Thanks!

- Joseph Geretz -
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

The earth is not spherical, so if you want a more exact value, you
should use the formula for an ellipse rather than a circle.

As it's not spherical, the radius varies with the latitude. What you
have seems to be the radius at the equator. The difference is only
0.19%, so again it depends on how exact you want the value to be.

Also, you should add the altitude over sea level to the radius if you
want a more exact value, but at five miles over sea level (Mount
Everest) the difference is only 0.12%
 
J

Joseph Geretz

Thanks, Goran,

You are correct of course, the Earth is not a perfect sphere, however the
assumption of a sphere yields close enough results for my purposes.
What you have seems to be the radius at the equator.

Not according to the information I've seen at
http://www.hypernews.org/HyperNews/get/trails/SAR/291/1.html
------------------------------------
Conceptually and practically, latitude is the same no matter where you go on
earth; however, in reality it varies from 69.41 statute miles per minute at
the poles to 68.70 statute miles per minute at the equator due to the earth
bulging slightly from its rotational spin.
------------------------------------

So, what I've done is assume an equally distributed gradient (again, an
assumption which might not be strictly correct, but close enough for my
purposes) and taken the average of 69.41 and 68.70 to arrive at an average
distance of approximately 69.04. Mathematically speaking, this comes out to
69.055, but I did see the figure 69.04 referenced somewhere, which is why
I've used it. Again, in the context of the accuracy which I need, I don't
think this deviation is significantly altering my results.

Thanks!

Joseph Geretz
 
J

Joseph Geretz

purposes) and taken the average of 69.41 and 68.70 to arrive at an average
distance of approximately 69.04. Mathematically speaking, this comes out
to 69.055, but I did see the figure 69.04 referenced somewhere,

Actually, it's right there in that same page:

http://www.hypernews.org/HyperNews/get/trails/SAR/291/1.html

-----------------------------------------
A degree of latitude is 60 nautical miles, or 69.04 statute miles. A minute
of latitude is equal to one nautical mile, or 6076 feet; thus, a second of
latitude (6076 divided by 60) is 101 feet, 3 inches. Conceptually and
practically, latitude is the same no matter where you go on earth; however,
in reality it varies from 69.41 statute miles per minute at the poles to
68.70 statute miles per minute at the equator due to the earth bulging
slightly from its rotational spin.
-----------------------------------------

- Joe Geretz -

Joseph Geretz said:
Thanks, Goran,

You are correct of course, the Earth is not a perfect sphere, however the
assumption of a sphere yields close enough results for my purposes.
What you have seems to be the radius at the equator.

Not according to the information I've seen at
http://www.hypernews.org/HyperNews/get/trails/SAR/291/1.html
------------------------------------
Conceptually and practically, latitude is the same no matter where you go
on earth; however, in reality it varies from 69.41 statute miles per
minute at the poles to 68.70 statute miles per minute at the equator due
to the earth bulging slightly from its rotational spin.
------------------------------------

So, what I've done is assume an equally distributed gradient (again, an
assumption which might not be strictly correct, but close enough for my
purposes) and taken the average of 69.41 and 68.70 to arrive at an average
distance of approximately 69.04. Mathematically speaking, this comes out
to 69.055, but I did see the figure 69.04 referenced somewhere, which is
why I've used it. Again, in the context of the accuracy which I need, I
don't think this deviation is significantly altering my results.

Thanks!

Joseph Geretz
 
P

Paul Hirose

Joseph Geretz said:
Also, I'm curious as to why the
formula proposed directly prior to the final solution doesn't work:

(pi/180) * R * cosA where R is the radius of the earth in miles and
A is the degree latitude.


It does work. If we use R = 4000 miles and latitude zero, then the
formula gives about 70 miles. At latitude 60, it gives about 35 miles,
as it should. Did you remember to convert latitude to radians before
passing it to cos()?

I like this second formula better than the first one you gave, because
earth radius is a more fundamental and easily verified value than
miles per degree.

There's no advantage in accuracy, though. Both formulas assume a
sphere. This is close enough for many purposes, since the oblateness
of the Earth is only about 1 part in 250.

To tune the solution for a specific latitude, compare your result to a
calculated value which does allow for non-spherocity. I think the
NGA's online calculator will produce such a figure:
http://www.nga.mil/MSISiteContent/StaticFiles/Calculators/degree.html

Multiply the equation by a fudge factor to make your program yield the
"right answer" at the latitude of interest.
 
J

Joseph Geretz

Hi Paul.
It does work. If we use R = 4000 miles and latitude zero, then the
formula gives about 70 miles. At latitude 60, it gives about 35 miles,
as it should. Did you remember to convert latitude to radians before
passing it to cos()?

OK, that explains it - no, I was not converting to radians.

Thanks for straightening that out for me.

- Joseph Geretz -
 
P

Peter Duniho

Ah, I see. (Kind of - I don't pretend to completely understand the
mathematics, but I can see how the radius can be derived from miles per
degree latitdute.)

I don't think he's saying it's derived from (though it could be). The
"magic number" in the formula was itself derived using the radius. In
other words, even though you don't see the radius used explicitly, it's in
there.
 
B

Bill Wilkinson

The multiplier--69.06 or 69.17 or 69.28--depends on your latitude, because of the flattening of the Earth into an oblate spheroid. Realistically, does it matter??? If two points are (say) 2 degrees apart (over 100 miles anywhere in the lower 48 states), then you won't be off by more than 0.22 of a mile in 100 or more miles.

If you are using this for zip code computations, that is much much more accurate than the zip codes themselves are.

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
L

Lew

Bill said:
The multiplier--69.06 or 69.17 or 69.28--depends on your latitude, because of the flattening of the Earth into an oblate spheroid. Realistically, does it matter??? If two points are (say) 2 degrees apart (over 100 miles anywhere in the lower 48 states), then you won't be off by more than 0.22 of a mile in 100 or more miles.

If you are using this for zip [sic] code computations, that is much much more accurate than the zip [sic] codes themselves are.

I have no idea what the context of this post was. What in the world is under
discussion here?

Some things about ZIP code boundaries: they are not regular, symmetrical,
coterminous with political boundaries, equal in size or even necessarily
convex. There are buildings with their own ZIP codes. How would any
geographically-based computation map reliably to ZIP codes?
 
Top