[csswg-drafts] [css-transforms] Interpolation of 2D matrices (#3709)

kevers-google has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-transforms]  Interpolation of 2D matrices ==
Interpolation of 2D matrices
(https://drafts.csswg.org/css-transforms/#interpolation-of-decomposed-2d-matrix-values)

The pseudo code for matrix interpolation contains the following:

// Don’t rotate the long way around.
if (!angleA)
    angleA = 360
if (!angleB)
    angleB = 360

if (abs(angleA - angleB) > 180)
    ...

Having conditions whose truth value depends on precise floating point tends to introduce sensitivity to small errors in numerical precision.  In this case, however, it looks like the !angle checks are superfluous.  Having an angle of 0 versus +/-1e-6 does not affect the interpolation path unless right at the 180 degree  boundary. Rotating from 360 to 181 degrees, is equivalent to rotating from 0 to -179 degrees.  These conditional angle tweaks from 0 to 360 should probably be removed from the spec.




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3709 using your GitHub account

Received on Wednesday, 6 March 2019 15:25:11 UTC