Open ted-piotrowski opened 3 years ago
@robertleeplummerjr I noticed you've been active on this project again. What are your thoughts on merging this fix?
@robertleeplummerjr @ted-piotrowski any update on merging this fix? this issue I believe relies on it.
Fixes #647
Previously the following cases failed:
According to MDN
Math.atan2(y, x)
returns a value between -PI and PI. According to OpenGLatan(y / x)
returns a value between -PI/2 and PI/2 whileatan(y, x)
returns a value between -PI and PI.The main fix was to change the
atan
signature to take(y, x)
instead of(y / x)
and then to handle the casesMath.atan2(-1, 0)
,Math.atan2(1, 0)
,Math.atan(0, 0)
because in OpenGLatan
is undefined whenx = 0
but defined in Javascript.Note:
atan
arguments are passedy
first and thenx
. This caused me some confusion at first.