# How to change quaternion when flipping X axis?

For a given animation with the set of 3D coordinates of every joint and corresponding global rotations quaternions Q(X, Y, Z, W) in right-hand coordinates (Y-up, X-left, Z-forward) - pic. I want to change axis X to be consistent with Unity (Y-up, X-right, Z-forward).

For coordinates it is obvoius: X' = -X and works as expected.

For rotations in quaternions assign I probed different options from other sources:

• X, -Y, -Z, W
• -X, Y, Z, W
• -X, Y, Z, -W

So, what math behind flipping X axis and how can I achieve this transformation?

X, -Y, -Z, W <-- This one is correct.
-X, Y, Z, W
Then, since you've flipped an odd number of axes, you're in a mirror image universe with reversed handedness, so the sign of the angle needs to change too. That means negating X, Y, and Z, giving the final result:
X, -Y, -Z, W