I need to rotate quaternion -90 degree around Y-axis. So, I am using https://stackoverflow.com/questions/4436764/rotating-a-quaternion-on-1-axis for it. Now I have below case,
I am getting multiplication of two quaternion Q1 and Q2 instead of seprate Q1 and Q2. So, Now how to rotate this multiplied quaternion.
As what I want is Q1-rotated * Q2-rotated but I am getting Q1 * Q2, which I can do is ((Q1 * Q2)-rotated) which is not right. As I can't change order of multiplication in quaternion i.e. Q1 * Q2 != Q2 * Q1, which means (Q1*rotation) * (Q2*rotation) != (Q1*Q2) * (rotation*rotation).
So basically I am having Q1 * Q2 and I want Q1-rotated * Q2-rotated where I know rotation.
Please suggest some way to solve this.
Update
I have result of (Q1 * Q2) and unit_rotating_quaternion and I want is (Q1*unit_rotating_quaternion) * (Q2*unit_rotating_quaternion), So Is there any way to find it ?
If $p$ is a unit rotating quaternion and $q$ is quaternion to be rotated, then $$ q'= pqp^{-1}. $$
You have $Q=q_1q_2$ and $q'_1=pq_1p^{-1}$, $q_2' = pq_2p^{-1}$, so: $$ Q'=q'_1q_2'=pq_1p^{-1}pq_2p^{-1} = pq_1q_2p^{-1} = pQp^{-1} $$ as expected.