We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
atan
atan2
Both dashed and zigzag use Math.atan:
Math.atan
const alpha = Math.atan((p2[1] - p1[1]) / (p2[0] - p1[0]));
It would seem that a generated vertical line would cause errors. Is there a reason for preferring this over the safer atan2 alternative?
const alpha = Math.atan2((p2[1] - p1[1]), (p2[0] - p1[0]));
The text was updated successfully, but these errors were encountered:
You're correct atan2 would be the better option here, because I don't check for the denominator to be nonzero.
Sorry, something went wrong.
I think I have been getting away with it because it is unlikely in zigzag lines, and the randomness in the dashed lines.
No branches or pull requests
Both dashed and zigzag use
Math.atan
:It would seem that a generated vertical line would cause errors. Is there a reason for preferring this over the safer
atan2
alternative?The text was updated successfully, but these errors were encountered: