My goal: the distance between two lines of longitude on a globe at different latitudes.

Would this be accurate?

cosine(latitude) * pi * radius^2 = latitudinal circumference?

then, that circumference / # of longitude lines = space between 2 of them at this latitude?

Anything simpler or more efficient in mind?

Thanks..

Working on a globe program

Would this be accurate?

cosine(latitude) * pi * radius^2 = latitudinal circumference?

then, that circumference / # of longitude lines = space between 2 of them at this latitude?

Anything simpler or more efficient in mind?

Thanks..

Working on a globe program

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

That whould be :

2 * cosine(latitude) * pi * radius = latitudinal circumference

when radius is the radius of the Earth and the Earth is seen as a perfect sphere.

>> then, that circumference / # of longitude lines = space between 2 of them at this latitude

indeed.

You might want to consult the link JR2003 posted though, because it explains how to calculate the distance between two points on the globe (not necessarily on the same latitude).

I suggest the haversine formula :

http://en.wikipedia.org/wiki/Haversine_formula

It's easy to calculate, and has a nice precision.

Note that the Earth is NOT a perfect sphere, so a good choice of the used radius is important (average radius should be OK for most applications).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trialYou'd probably be most interested in the ECEF <-> WGS84 lat lon height conversions in the "Datum Conversions" section. They have the actual formulas there.

it sounds like you might not be wanting the great circle distance between two points.

If you are wanting the lenght of the path between two lines of longitude while traveling at a constant latitude, then you could use

cosine(latitude) * pi * radius*2 = latitudinal circumference

assuming the globe in question is a sphere.

Although I'm not sure of the purpose of your goal, since traveling at a constant latitude can be almost pi/2 times longer than a great circle path,

e.g. from 90° East to 90° West when traveling along 89°59' North latitude instead of a direct path from 90° East 89°59' North to 90° West 89°59' North

But then, if you aren't restricted to a particular latitide, then the distance between any two lines of longitude is 0, since they all meet at the poles.

Math / Science

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.