Quaternions

Complexity to the fourth dimension.

So, I just got into this subject that mathematicians refer to as "quaternions". And, since this is the lounge sub-forum, I thought I should ask a few questions about it..
When I have two quaternions, Q1 and Q2, respectively assigned the following values for their real components (in a+bi+cj+dk, a, b, c and d are the real components): {2, 3, 4, 5} and {3, 4, 5, 6}.
When I then type this into my calculator and do some simple matrix calculations:
Q1*Q2 = {68}
Q2*Q1 = { {6, 9, 12, 15}, {8, 12, 16, 20}, {10, 15, 20, 25}, {12, 18, 24, 30} }
(Note: I defined Q1 as a 1x4 Matrix and Q2 as a 4x1 Matrix.)

I understand the second output, since this is just 3 * {2, 3, 4, 5}, 4 * {2, 3, 4, 5}, etc. But, what does the first calculation evaluate to, what does this number represent?

More questions might pop-up on the way, as this is a rather new subject to me.

Thanks in advance for even reading this topic up to this point.


EDIT:
Changed the Q1*Q2 equation, was not paying attention when writing it down.
Last edited on
Mmmm... What you do there is matrix multiplication, not quaternion multiplication. You are almost right about Q2*Q1 (it's 3*{2,3,4,5}, 4*{2,3,4,5}, ...). As for Q1*Q2, the result is calculated like this:

2*3 + 3*4 + 4*5 + 5*6 = 68 (I use bold for the Q1 elements).

Although I have a maths degree, quaternions wasn't a mandatory course, thus I'm not familiar with the subject (but I'm quite sure that this is not how you multiply quaternions). All I know is that they are used in 3D graphics for rotation. Maybe hamsterman (or someone else) can explain this better.
Last edited on
Whoops, was not paying attention when writing down the equations, too lazy to change them now, too. So, yeah, that would make sense. This does have a lot to do with quaternion, since they are expressed in 4 "dimensions" (1 real and 3 imaginary). A quaternion is a "more complex" number than regular imaginary numbers:

i2 = j2 = k2 = ijk = -1

We can now get the value of i, j, and k, expressed in the other variables like this:
-1 = ijk
Times i
-i = i2jk
-i = (-1)jk
i = jk

Doing the same for the others, we get:
i = jk
j = ik
k = ij
-i = kj
-j = ki
-k = ji

And there's a bunch of other things going on which I can't explain better than a simple google search.

EDIT:
Just another thing, the latter equation has something to do with quaternions, as it returns a set of multiplications of 1, i, j and k, but.. what does the other value represent in this context?

EDIT:
Found out the striped through question; the values are irrelevant, that's all there is to say about it.
Last edited on
Umm, one natural way to write down quaternions is with 4x4 matrices, ( I doubt you'll get something good with 1x4 matrices).

Wikipedia tells you how to write quaternions with 2x2 *complex* matrices. You can turn any n by n complex matrix to a real 2n by 2n matrix by substituting
a+ib
with the matrix
1
2
(a -b)
(b  a)


So, the 4 complex matrices (2 by 2 each) given in Wikipedia can be written as 4x4 real matrices:

1->
1
2
3
4
(1  0  0  0)
(0  1  0  0)
(0  0  1  0)
(0  0  0  1)

i->
1
2
3
4
(0 -1  0  0)
(1  0  0  0)
(0  0  0  1)
(0  0 -1  0)

j->
1
2
3
4
(0  0  1  0)
(0  0  0  1)
(-1 0  0  0)
(0 -1  0  0)

k->
1
2
3
4
(0  0  0 -1)
(0  0  1  0)
(0 -1  0  0)
(1  0  0  0)


You can now verify that the defining equalities you wrote for the quaternions hold for these 4x4 matrices.

Taking linear combinations of them gets you all quaternions.

A nice exercise: write a parser for quaternion expressions. Then simplify the quaternion expressions. Finally, print out the matrix form of the result.

Of coures, such an exercise would take you looooots of time.
Last edited on
kyon, it is an interesting area of math.

I find thinking of it as "directionally determined " multiplication through the standard i - j - k orientation is helpful. When you go the opposite direction you get the negative. In the above you have:

j = ik and -j = ki

That looks reversed to me and should be j = ki and -j = ik.
That looks reversed to me and should be j = ki and -j = ik.

ijk = -1
i(j2)k = -j
i(-1)k = -j
ik = j
tition wrote:
1->
1
2
3
4
(1  0  0  0)
(0  1  0  0)
(0  0  1  0)
(0  0  0  1)

Wouldn't that be:
1
2
3
4
(1  0  0  0)
(0 -1  0  0)
(0  0 -1  0)
(0  0  0 -1)
, considering that i2 = j2 = k2 = -1?
Since all of them are just rewrites of the multiplication tables (with the signs of the relevant values).
Last edited on
Since all of them are just rewrites of the multiplication tables (with the signs of the relevant values).


Nope, they aren't.


You are right, it is a rewrite of the multiplication table. As 1*i=i, 1*j=j, 1*k=k, the signs should be +1.

P.S. sorry for the late reply.
Last edited on
Just, how is a quaternion multiplication performed, given two simple example quaternions?
Topic archived. No new replies allowed.