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

fix h3_great_circle_distance accepting degrees instead of rads #106

Merged
merged 2 commits into from
May 31, 2024

Conversation

isaacbrodsky
Copy link
Owner

Fixes #105

src/h3_misc.cpp Outdated
LatLng latLng0 = {.lat = lat0, .lng = lng0};
LatLng latLng1 = {.lat = lat1, .lng = lng1};
LatLng latLng0 = {.lat = radsToDegs(lat0), .lng = radsToDegs(lng0)};
LatLng latLng1 = {.lat = radsToDegs(lat1), .lng = radsToDegs(lng1)};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this backwards? The input is degrees, right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yes, this is backwards. I've now checked the results against another online calculator & confirmed I get results that look comparable.

@isaacbrodsky isaacbrodsky enabled auto-merge (squash) May 31, 2024 16:42
@isaacbrodsky isaacbrodsky merged commit a304010 into main May 31, 2024
22 checks passed
@isaacbrodsky isaacbrodsky deleted the fix-great-circle-distance-degrees branch May 31, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input for h3_great_circle_distance expects radians, not degrees
2 participants