Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad value of EARTH_RADIUS #5051

Closed
cffk opened this issue Apr 23, 2018 · 4 comments
Closed

Bad value of EARTH_RADIUS #5051

cffk opened this issue Apr 23, 2018 · 4 comments
Labels

Comments

@cffk
Copy link

cffk commented Apr 23, 2018

EARTH_RADIUS is earth's radius for use in great circle calculations where the earth is treated as a sphere. The recommended value for such a quantity is the mean radius = (2a + b)/3 = 6371 km. The value defined in coordinate_calculation.hpp and haversine.hpp is about (3a + b)/4 = 6372.8 km. There's no justification for this value.

@danpat
Copy link
Member

danpat commented Apr 23, 2018

@cffk Ultimately, the 6372.8km value comes from http://math.wikia.com/wiki/Ellipsoidal_quadratic_mean_radius. I believe it was copied from libosmium

Whether it's the right thing to use or not is another question. We have a PR open at the moment here #5041 that will likely deprecate this constant.

@cffk
Copy link
Author

cffk commented Apr 23, 2018

Yes, I know about this source. Unfortunately, I can't make head or tail of it. There's a long discussion between me and Kaimbridge, the proponent of the quadratic mean radius here. Click on the "show" for the "extended discussion".

Copy link

github-actions bot commented Jul 8, 2024

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 8, 2024
@1ec5
Copy link
Member

1ec5 commented Jul 9, 2024

The constant is still there:

// earth radius varies between 6,356.750-6,378.135 km (3,949.901-3,963.189mi)
// The IUGG value for the equatorial radius is 6378.137 km (3963.19 miles)
const constexpr long double EARTH_RADIUS = 6372797.560856;

But nothing uses it anymore as of #6315.

@1ec5 1ec5 closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants