3d vector rotation using both quaternions and the rotation matrix