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 mistake in greatCircleAngle #19789

Merged
merged 3 commits into from
Jan 29, 2021
Merged

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
The function greatCircleAngle returned inaccurate results in previous versions. This closes #19769.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Jan 29, 2021
@@ -95,7 +95,7 @@ void geodistInit()

sphere_metric_meters_lut[i] = static_cast<float>(sqr((EARTH_DIAMETER * PI / 360) * cos(latitude)));

sphere_metric_lut[i] = cosf(latitude);
sphere_metric_lut[i] = sqr(cosf(latitude));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be sqrf?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok.

@hombit
Copy link
Contributor

hombit commented Jan 29, 2021

Thank you, looks good for me!

@alexey-milovidov alexey-milovidov self-assigned this Jan 29, 2021
@alexey-milovidov alexey-milovidov merged commit 276e972 into master Jan 29, 2021
@alexey-milovidov alexey-milovidov deleted the fix-great-circle-angle branch January 29, 2021 18:35
vitlibar pushed a commit that referenced this pull request Feb 1, 2021
…7d6d7985224700ad6876b675d7c7c9

Cherry pick #19789 to 20.12: Fix mistake in greatCircleAngle
vitlibar pushed a commit that referenced this pull request Feb 1, 2021
…7d6d7985224700ad6876b675d7c7c9

Cherry pick #19789 to 20.11: Fix mistake in greatCircleAngle
vitlibar pushed a commit that referenced this pull request Feb 1, 2021
…d6d7985224700ad6876b675d7c7c9

Cherry pick #19789 to 21.1: Fix mistake in greatCircleAngle
alexey-milovidov added a commit that referenced this pull request Feb 19, 2021
Backport #19789 to 21.1: Fix mistake in greatCircleAngle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

greatCircleAngle is very inaccurate
3 participants