The rotation of the angle x around the axis (u, v, w) can be represented by a quaternion with the real part cos (x / 2) and the unreal part sin (x / 2) * (u, v, w).
If the coordinates of the axis (u, v, w) in the original trihedron are (u, w, w), they will be (u, w, v) in your trihedron.
Thus, if the original quaternion was (a, b, c, d) - a + ib + jc + kd - the quaternion should be converted to (a, b, d, c) in your trihedron.
EDIT
But since your trihedron is left, the angle must also be canceled, so the same rotation can finally be expressed by the quaternion (a, -b, -d, -c) in your trihedron.
source share