Graphics Reference
In-Depth Information
⎡
⎤
⎦
⎡
⎣
⎤
2
(y
2
+
z
2
)
1
−
2
(xy
+
sz)
2
(xz
−
sy)
x
u
y
u
z
u
⎣
⎦
q
−
1
pq
2
(x
2
z
2
)
=
2
(xy
−
sz)
1
−
+
2
(yz
+
sx)
2
(x
2
y
2
)
2
(xz
+
sy)
2
(yz
−
sx)
1
−
+
(11.6)
which is the transpose of (
11.3
)for
qpq
−
1
.
11.3.1 Quaternion Products and Matrices
The second way to derive (
11.3
) depends upon representing a quaternion product in
matrix form. For example, given
q
1
=
s
1
+
x
1
i
+
y
1
j
+
z
1
k
q
2
=
s
2
+
x
2
i
+
y
2
j
+
z
2
k
their product is
q
1
q
2
=
(s
1
+
x
1
i
+
y
1
j
+
z
1
k
)(s
2
+
x
2
i
+
y
2
j
+
z
2
k
)
=
s
1
s
2
−
x
1
x
2
−
y
1
y
2
−
z
1
z
2
+
s
1
(x
2
i
+
y
2
j
+
z
2
k
)
+
s
2
(x
1
i
+
y
1
j
+
z
1
k
)
+
(y
1
z
2
−
y
2
z
1
)
i
+
(x
2
z
1
−
x
1
z
2
)
j
+
(x
1
y
2
−
x
2
y
1
)
k
=
s
1
s
2
−
x
1
x
2
−
y
1
y
2
−
z
1
z
2
+
(s
1
x
2
+
s
2
x
1
+
y
1
z
2
−
y
2
z
1
)
i
+
(s
1
y
2
+
s
2
y
1
+
x
2
z
1
−
x
1
z
2
)
j
+
(s
1
z
2
+
s
2
z
1
+
x
1
y
2
−
x
2
y
1
)
k
⎡
⎣
⎤
⎦
⎡
⎣
⎤
⎦
s
1
−
x
1
−
y
1
−
z
1
s
2
x
2
y
2
z
2
x
1
s
1
−
z
1
y
1
q
1
q
2
=
.
y
1
z
1
s
1
−
x
1
z
1
−
y
1
x
1
s
1
At this stage we have quaternion
q
1
represented by a matrix, and
q
2
represented by a
column vector. Now let's reverse the scenario without altering the result by making
q
2
the matrix and
q
1
the column vector:
⎡
⎣
⎤
⎦
⎡
⎣
⎤
⎦
s
2
−
x
2
−
y
2
−
z
2
s
1
x
1
y
1
z
1
−
x
2
s
2
z
2
y
2
q
1
q
2
=
.
−
y
2
z
2
s
2
x
2
z
2
y
2
−
x
2
s
2
So now we have two ways of computing
q
1
q
2
and we need a way of distinguish-
ing between the two matrices. Let's call the matrix that preserves the left-to-right
quaternion sequence
L
and the matrix that reverses the sequence to right-to-left,
R
: