Docsity

Quaternions: Generalized Complex Numbers for Rotations, Study notes of Computer Graphics

Partial preview of the text

Download Quaternions: Generalized Complex Numbers for Rotations and more Study notes Computer Graphics in PDF only on Docsity!

Quaternions Complex numbersQuaternions are essentially generalized complex numbers^ • a scalar part + a vector part — 1 real and 3 imaginary parts• norm • basic quaternion operation is multiplication

,^

c^ a^

2 b = + = − i i

=^

=^

+^ +^

x y z ]) =

( ,^ )^

( , [

q^ s^

s^

s^ x^ y

z

v^

i^ j^

k

=^ +^

+^ +^

+^ +^

=^ −^

⋅^ ×

+^ +

'^ (^

)( '^ '^

'^ '^ )

(^ '^

',^

'^ '^

'^ )

qq^ s^

x^ y^

z^ s^

x^ y^

z

ss^

s^ s

i^ j^

k^

i^ j^

k

v v^ v

v^ v

v

2 2

2 2

||^ || q^

w^ x^

y^ z

=^ +

+^

1,^ ,^ +

=^ =^

= −^

=^

=^ =

2 2

2

i^ j^

k^

ij^ k^ jk

i^ ki^

j

Quaternions (continued)^ ConjugateInversion We’re interested in the class of unit quaternions^ • forms a unit sphere in 4-D space• can be used to represent the set of rotations• forms a group with multiplication as the operation

=^ −^

=^ −^

−^ − ( ,^ ) q s^

s^ x^ y

z v^

i^ i^

k q −1 q =^2 q (^2) q qq^ s

(^22)

=^ =^

+^ = 1 v

Quaternion-Matrix Conversion Quaternion can also be converted to equivalent rotation matrix

y q z^

xy^ wz^

xz^ wy

xy^ wz^

x^ z^

yz^ wx

xz^ wy^

yz^ wx^

x^ y 2 2

2 2

2 2

^

1− 2^ − 2
− 2^
2 + 2^
^
2 + 2^
1− 2^ − 2
− 2^
^
= ^
2 − 2^
2 + 2^
1− 2^ − 2
^
^
M

[^

]

(^ ,^

q^ w^ x

y^ z =

Matrix-Quaternion Conversion Rotation matrix can be converted to equivalent rotation axisand angle, and further to quaternion^11

12

13 21 22

23 31 32

^
^
^
= ^
^
^

m^ R m^ m m m^ m m m^ m M

θ

θ θ^ π^

θ −1 θ 11

22 33 32 23 13 31 21 12

+^ +^

^

=^ ^

^

1 ^

=^

2 ^

^

= 2^ −^

If^112 1 = = 0can be arbitrary

or

If

, cos^

sin ,^

M^ I^ R R

m^ m^

m

m^ m m^ m m^ m

1 M I

2 1

u

u^ u u

θ^ θ= (cos ,^ sin^2

q^

u