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 broken angle calculation with negative epsilon numbers #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SeriousAlexej
Copy link

@SeriousAlexej SeriousAlexej commented Oct 31, 2020

When calculating Cos(-epsilon) or Sin(-epsilon), the result is incorrect.
The behavior is due to WrapAngle(-epsilon) returns exactly 360 degrees,
and int iQuadrant = int(360.0/90.0); // iQuadrant == 4, which is actually a quadrant with index 0. So this operation must be wrapped around to produce stable results. Otherwise, index 4 is reading past the end of corresponding array.

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.

1 participant