Clean up euler-angles related part of math. (reverted from commit fe580ac88e056b34b2b1273ffc63ba055ea0ee72)