MATH: Change the rotation3d implementation to allow different rotation orders.