





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Interactive Computer Graphics; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2009;
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Quaternions Quaternions are 4-D numbers
q^ =
s^
+^ x
i^ +
y j^
+^ z
k
Hamilton Math Inst.,Trinity College
Quaternions Complex numbers Quaternions 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^
b =^
i^
i
x y z ]) =
q^
s^
s^
s^
x^
y^
z
v^
i^
j^
k
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
2
2
2
i^
j^
k^
ij^
k^
jk^
i^
ki^
j
Rotations With Quaternions Rotations in a 2D plane using complex numbers Given a point
p^ and an axis
u
-^ construct the unit quaternion •^ compute the product •^ the resulting point
p ′^
is^ p
rotated by
θ^ about
u θ^
θ
=^
2
2
(cos
,
sin
)
q^
u −^1
0
=^
0
( ,
')
( ,
) q^
q
p^
p
(^
)
[^
]^
,^
cos
sin
'^
cos(
)^
sin(
)
[ cos(
)^
sin(
)]
i^
i
i^ i^
i
c^
a b
a^
b^
re^
d^
e
c^
cd^
re e
re^
r^
r
r^
r
φ
θ
φ^ θ
φ^ θ
θ^
θ φ^
θ
φ^
θ
φ^
θ
φ^
θ
=^
=^
+^
=^
=^
+^
=
=^
=^
=^
=^
+^
+^
=^
+^
i^
i
i
u p
q^ p
-1 q cos
sin 2
2
q
θ^
θ
=^
+^ u
Quaternion-Matrix Conversion Quaternion can also be converted to equivalent rotation matrix
q
y^
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
0
⎢^
⎥
2
1− 2
− 2
2
− 2^
0
⎢^
⎥
= ⎢^
⎥
2
− 2^
2
1− 2
− 2
0
⎢^
⎥
0
0
0
1
⎣^
⎦
M
T^
T^
( ,^
)^
cos
(^
)^ (sin
)
θ
θ
θ
=^
+^
−^
R^
u^
uu
I^
uu
u
θ^
θ
=^
=^
2
2
])
(^
, [^
(cos
,
sin
)
q^
w^
x^
y^
z^
u
Looking At Quaternions Quaternions have a big advantage over Euler angles
-^ can interpolate between rotations much more nicely •^ using scheme called Spherical Linear Interpolation (SLERP)^ –
walk along great circle connecting two points on 4-D unit sphere But interpolating multiple rotations is more complicated Quaternions have some other nice advantages too
-^ more compact than rotation matrices •^ can compose rotations by quaternion multiplication •^ but they can be easily converted to matrices if needed
1
1
2
1
1
2
α α
−
SLERP Exponential map^ q
= exp(
u ) = cos
u
The base orientation consisting of a zerodegree rotation is represented by the unitquaternion
1 + 0
i^ + 0
j^ + 0
k
We can interpolate from the base orientationto a given orientation (
θ , u
) as
q ( t
) = cos
u^
sin
t ( e θ/2)
u
To interpolate from
q^1
to^ q
we can 2 ,
interpolate from the base
q ( t
q^1
( q^1
-1 q
t ) 2