Interpolating rotations using quaternions