-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #2198 and #2199 #2204
base: develop
Are you sure you want to change the base?
Fix #2198 and #2199 #2204
Conversation
Fix scratchfoundation#2198 and scratchfoundation#2199 Take angle modulus 360 to avoid issues with floating point decimal accuracy. Round to 10 digits using Math.round and division instead of stringifying.
Thanks for fixing this! MathUtil.tan still stringifies + unstringifies, however--might want to get that fixed in this PR as well. |
Done. |
This seems good, I think. Only one thing that might be good is adding the modulus to the tangent as well, since that seems to have the same sorts of issues. Otherwise, I think this is ready to merge! |
@AmazingMech2418: Unless I'm missing something, tangent already does that (see MathUtil.tan - expand the second file being changed). |
Yeah, I just saw that. You are correct. |
@cwillisf |
Fix #2198 and #2199
Take angle modulus 360 before multiplying my Math.PI to avoid issues with decimal accuracy when the angle measure gets large. (#2199)
Round to 10 digits using Math.round and division instead of stringifying (#2198). This should result in some performance improvements.