Okay, so I have been studying quaternions in a game development course, specifically studying how quaternions are used in rotating 3D objects.
My issue here, is that the textbook only gives me the equations about how quaternions arithmetic is done, the complex conjugate of a quaternion, and even a basic rotation matrix for rotation via matrices, but everything given is written in a general form, ergo $q = a + bi + cj + dk$.
I currently have a basic understanding of quaternions, but I cannot truly understand without something more TANGIBLE (the caps are just for emphasizing, not me yelling or anything).
I want to see examples of quaternions IN ACTION. Like, an example of an object in 3D space with a quaternion to describe its current rotation (no written ABSTRACTLY like $a+bi+cj+dk$, but CONCRETLY like $0+2i+4j+3k$ <- no remote idea if that is even usable) Then I want to see CONCRETE quaternions that rotate said object in several ways ($90$ degree turn in one direction, $45$ degree turn in another, etc.).
Can anyone here give some CONCRETE examples here, or can anyone tell me where I can find such example. Help is very much appreciated.
-Thanks
I highly recommend that you come up with some example on your own and work through them. Start simple and then churn through the math by hand. Once you get the basics down, then code more complicated example in Matlab, Octave or some other equivalent. If you know the definition of a quaternion work up some basic examples to see if they work. You know that the encoding for a quaternion rotating a vector by $\theta$ degrees about axis $\hat{n}$ is:
$$q = \cos(\theta/2) + \hat{n}\sin(\theta/2)$$
and to rotate a vector $v$ using the quaternion we use
$$ v' = qvq^*$$
where $q^*$ is the conjugate of $q$ (real part is negated).
Now let's try some simple examples. We want to rotate 180 degrees about the Z axis. So we let $\theta = \pi$ and $\hat{n} = 0i + 0j+1k$. So we have
$$q = \cos(\pi/2) + (0i + 0j+1k)\sin(\pi/2) = 0 + k = k$$
and
$$q^* = - k$$
Lets apply this to a vector along the x axis let's choose $v=2i + 0j +0k$ (note that vectors undergoing rotation do not have a real part).
So we have
$$ v' = qvq^* = (k)(2i + 0j +0k)(-k) = -2i$$
just as we would expect. Now lets try $v=2i + 2j +2k$. We expect that both the x and y components will be negated, but z should be left alone
$$ \begin{align} v' &= qvq^* \\ &= (k)(2i + 2j +2k)(-k) \\ &= (2ki + 2kj +2kk)(-k) \\ &= (2j + 2(-i) +-2)(-k) \\ &= 2j(-k) + 2(-i)(-k) +-2(-k) \\ &= 2(-i) + 2(-j) +2k \\ &= -2i - 2j +2k \end{align}$$
which is the exact result that we expected.
What if we rotated the vector $0i + 0j +2k$? It should be unaffected. Lets try it.. $$ v' = qvq^* = (k)(0i + 0j +2k)(-k) = (0i + 0j -2)(-k)=(0i + 0j +2k)$$
just as we would expect.
I recommend that you try 180 degree rotations about other coordinate axes. Then try a 180 degree rotation about $i+j$ (remember to normalize the axis). This should flip the z axis and it should also flip any vector of the form $ai-aj$.
Once you are comfortable with 180 degress, work through the same process with 90 degrees. You are then well on your way to arbitrary angles and axes. Good luck.