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

Distance Check Approximation #302

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Distance Check Approximation #302

merged 2 commits into from
Oct 31, 2024

Conversation

willhuff0
Copy link
Contributor

I've roughly ported the distance check implementation from Prox.

It adds an equirectangular approximation for checking distances less than 1.5 km. Above which, the accuracy begins to drift significantly. If we ever need to check larger distances, the haversine distance equation (previous default) will be used.

This saves multiple resource intensive sqrt and trig operations reducing load on the server without loosing functionality.

Copy link
Collaborator

@h1divp h1divp left a comment

Choose a reason for hiding this comment

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

Thank you, this simplifies the affected code and the distance checking is much more accurate. Perhaps if we do set very large radii for messages then this will be incredibly helpful. The math work is also always appreciated.

I am accepting this PR, but note that I have not fully tested this since we still don't have thorough good enough checks for how accurate the message communication is with respect to geography. I just created issue #306 to address this.

@h1divp h1divp merged commit df32efd into ufosc:main Oct 31, 2024
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.

2 participants