473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Calculating Miles per Degree Longitude - Check my Math Please

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 -
Mar 13 '07 #1
10 11570
Assuming you are describing only movement eastward or westward, that looks
right. The cosine of the latitude is the crucial factor.

Mar 14 '07 #2
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
Mar 14 '07 #3
(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

"Hans Kesting" <ne***********@spamgourmet.comwrote in message
news:c0*************************@news.microsoft.co m...
>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


Mar 14 '07 #4
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 -

"Michael A. Covington" <lo**@ai.uga.edu.for.addresswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Assuming you are describing only movement eastward or westward, that looks
right. The cosine of the latitude is the crucial factor.

Mar 14 '07 #5
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%
Joseph Geretz wrote:
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 -


--
Göran Andersson
_____
http://www.guffa.com
Mar 14 '07 #6
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.
>private const double MilesPerDegLat = 69.04;
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/g...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

"Göran Andersson" <gu***@guffa.comwrote in message
news:eN**************@TK2MSFTNGP05.phx.gbl...
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%
Joseph Geretz wrote:
>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 -


--
Göran Andersson
_____
http://www.guffa.com

Mar 14 '07 #7
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/g...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" <jg*****@nospam.comwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
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.
>>private const double MilesPerDegLat = 69.04;
>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/g...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

"Göran Andersson" <gu***@guffa.comwrote in message
news:eN**************@TK2MSFTNGP05.phx.gbl...
>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%
Joseph Geretz wrote:
>>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 -


--
Göran Andersson
_____
http://www.guffa.com


Mar 14 '07 #8
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:ei**************@TK2MSFTNGP05.phx.gbl...
>
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/St...rs/degree.html

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

--
Paul Hirose <jv********@earINVALIDthlink.net>
To reply by email remove INVALID

Mar 15 '07 #9
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 -
"Paul Hirose" <jv********@earINVALIDthlink.netwrote in message
news:We*****************@newsread3.news.pas.earthl ink.net...
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:ei**************@TK2MSFTNGP05.phx.gbl...
>>
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/St...rs/degree.html

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

--
Paul Hirose <jv********@earINVALIDthlink.net>
To reply by email remove INVALID

Mar 15 '07 #10
On Wed, 14 Mar 2007 23:47:48 +0800, Joseph Geretz <jg*****@nospam.com>
wrote:
>(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.)
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.
Mar 15 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Mark Tranchant | last post by:
A new project: http://step-by-step.org.uk/ Don't worry about the links yet, the content hasn't been written. I'm just interested in the introduction screen, which is my first attempt at an...
17
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels...
3
by: D. Shane Fowlkes | last post by:
(still a .NET newbie) I have a chunk of code in a Page_Load routine that pulls data from a SQL Server table. The Select statement looks for any "events" scheduled for today. Then my IF...
2
by: chb1980 | last post by:
the following data is taken from a ploynomial x : -2 , -1 , 0 , 1 , 2 , 3 P(x) : -5 , 1 , 1 , 1 , 7, 25 1) what is the degree of P(x) ? please ..
3
Fspinelli
by: Fspinelli | last post by:
I have a table with various information (company name, address, etc.) plus five check boxes. One or more of those check boxes may be ticked as it relays a type of status to the end user. I have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.