-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Test the trigonometry routine on remarkable angles #164
Conversation
The trigonometric values for those angles are known exactly (expressed in terms of basic arithmetic and square roots).
This precludes using it outside an Hypothesis test, like in rotate/test_remarkable_angles.
This is the same convention used by Vector2._trig, which makes things a bit clearer and more convenient.
I mentioned on Discord that |
I should note that if we have imprecision/inconsistency in these angles, I think we should take the answer that gives us smooth curves than what's 100% correct. bors r+ |
164: Test the trigonometry routine on remarkable angles r=astronouth7303 a=nbraud - [x] Compare the remarkable angles to `Vector._trig`, and not `cos, sin`, in `test_remarkable_angles`. - [x] Tighten-up the tolerances on that test. - [x] Modify `utils.isclose` to be usable outside Hypothesis. - [x] Modify `rotate/remarkable_angles` to use the same convention as `Vector._trig`. Co-authored-by: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
@astronouth7303 What do you mean by “smooth curves“ here ? In any case, rotations should be “smooth” for whatever reasonable meaning of it; I can probably write a test to check they are 1-Lipschitz. |
I just mean, I don't want any perturbances or "bumps" or jitter caused by certain angles being hardcoded or whatever. |
Build succeeded
|
@astronouth7303 Oh, yes; only the test uses known values, not the implementation. |
Vector._trig
, and notcos, sin
, intest_remarkable_angles
.utils.isclose
to be usable outside Hypothesis.rotate/remarkable_angles
to use the same convention asVector._trig
.