Math.RAD_PER_DEG and Math.DEG_PER_RAD constants have invalid names in the current spec:
Math.RAD_PER_DEG is equal to 180 / PI, but must be equal PI / 180, because this constant means radians in one degree. Also Math.radians(degrees) must be computed as
- 2. Let radians be (degrees × Math.DEG_PER_RAD).
+ 2. Let radians be (degrees × Math.RAD_PER_DEG).
Accordingly Math.DEG_PER_RAD must be equal 180 / PI, because it means number of degrees in one radian, and Math.degrees(radians) must be computed as:
- 2. Let degrees be (radians × Math.RAD_PER_DEG).
+ 2. Let degrees be (radians × Math.DEG_PER_RAD).
Math.RAD_PER_DEG
andMath.DEG_PER_RAD
constants have invalid names in the current spec:Math.RAD_PER_DEG
is equal to180 / PI
, but must be equalPI / 180
, because this constant means radians in one degree. AlsoMath.radians(degrees)
must be computed asAccordingly
Math.DEG_PER_RAD
must be equal180 / PI
, because it means number of degrees in one radian, andMath.degrees(radians)
must be computed as:Looks like this issue was introduced in the following commit https://github.com/rwaldron/proposal-math-extensions/commit/b31aee6b970ee991e37b2b3e3cbd4914f60e3800