As reported by mimo in rP20263, the rotate function changes the x coordinate while needing the original x coordinate in the second statement.
This wasn't found by the test in rP20262 because that coincidentally still works for 90° rotations.
So the test should tap more angles.
Other angles weren't tested before because the approximations of our sin and cos functions are lossy.
So we have to allow an error margin if we want to reveal the bug in the tests.