# Quaternion axis and angles

I have three unit quaternions,

$$q_1=(1,0,0,0)\\ q_2=(0.9623,0.2578,0.0226,0.0842)\\ q_3=(0.9353,0.2273,0.2708,0.0146)$$

Now, quaternion q, if represented by angle axis convention, will be $$q=cos(\theta/2)+sin(\theta/2)\cdot\hat n$$, So each quaternion will have its separate angle and axis. Now when we multiply two quaternions say from $$q_1$$ to $$q_2$$ they will rotate about an axis and at a certain angle. How are the rotation axis and angle between them related to the individual quaternion axis and angle?

If I want to generate quaternions $$q$$ rotating from $$q_2$$ to $$q_3$$ using spherical interpolation(slerp), $$q\in[q_2,q_3]$$, What will be the axis of rotation? Will it change for each $$q$$? Can anyone generate 5 quaternions rotating from $$q_2$$ to $$q_3$$ using slerp?

Complex numbers are couples, they have a real part and an imaginay part. Quaternions are hypercomplex numbers, they are also couples of a real part $$w$$ and an imaginary vector part $$b = (x i, y j, z k)$$.

Quaternions are tipically parameterized by two parameters: rotation angle $$\theta$$ and rotation axis (unit vector) $$n$$. The real part is $$w = \cos(\frac{\theta}{2})$$ while the vector part is $$b = \sin(\frac{\theta}{2}) n$$.

Given two qaternions $$q_1 = (w_1, b_1)$$ and $$q_2 = (w_2, b_2)$$ their multiplication in vector form is:

$$q_1 q_2 = (w_1, b_1) (w_2,b_2)$$

$$q_1 q_2 = (w_1 w_2 - b_1 \cdot b_2, w_2 b_1 + w_1 b_2 + b_1 \times b_2)$$

After multiplication the new rotation axis is:

$$b_3 = (w_2 b_1 + w_1 b_2 + b_1 \times b_2)$$

$$b_3$$ has one component in the plane spanned by $$b_1$$ and $$b_2$$ ($$w_2 b_1 + w_1 b_2$$) and one component in the direction orthogonal to that plane ($$b_1 \times b_2$$).

The case of the SLERP ia a little bit different. Looking at the SLERP formulae:

$$q(t) = \frac{1}{\sin(\frac{\theta}{2})}( \sin((1-t)\frac{\theta}{2}) q_1 + \sin(t \frac{\theta}{2}) q_2)$$

Or

$$q(t) = \frac{1}{\sin(\frac{\theta}{2})}( \sin((1-t)\frac{\theta}{2}) (w_1, b_1) + \sin(t \frac{\theta}{2}) (w_2, b_2))$$

Where $$\theta = 2 \cos^{-1}(n_1 \cdot n_2)$$ is the angle formed between the axis of rotation of $$q_1$$ and $$q_2$$. So the interpolated axis of rotation is:

$$b_t = \frac{1}{\sin(\frac{\theta}{2})}( \sin((1-t)\frac{\theta}{2}) b_1 + \sin(t \frac{\theta}{2}) b_2)$$

Which is in the plane spanned by $$b_1$$ and $$b_2$$ (in between $$b_1$$ and $$b_2$$ to be precise), the expected behavior of SLERP.

• So the axis of rotation and magnitude of bt will change with varying t? Commented Jul 22, 2019 at 4:32
• Yes, the axis of rotation and the magnitude of $b_t$ are spherically interpolated values except in the cases when $t = 0$ and $t = 1$. Commented Jul 22, 2019 at 5:20
• Also, the axis of rotation won't change in any case if $b_1$ and $b_2$ are collinear. In that case only the angle of rotation will change. Commented Jul 22, 2019 at 5:30