Professional Documents
Culture Documents
1. Representing position
• Definition: coordinate frame
– A set n of orthonormal basis vectors spanning Rn
– For example: ⎡1 ⎤ ⎡0 ⎤ ⎡0 ⎤
iˆ = ⎢0 ⎥ , ˆj = ⎢1 ⎥ , kˆ = ⎢0 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢⎣0 ⎥⎦ ⎢⎣0 ⎥⎦ ⎢⎣1 ⎥⎦
• When representing a point p, we
need to specify a coordinate frame
– With respect to o0: p 0 = [5 6]
T
Alternate approach
• Rotation matrices as projections
– Projecting the axes
of o1 onto the axes
of frame o0
⎡ xˆ ⋅ xˆ ⎤ ⎡ yˆ ⋅ xˆ ⎤
x10 = ⎢ 1 0 ⎥ , y10 = ⎢ 1 0 ⎥
⎣ xˆ1 ⋅ yˆ 0 ⎦ ⎣ yˆ1 ⋅ yˆ 0 ⎦
⎡ xˆ ⋅ xˆ yˆ1 ⋅ xˆ0 ⎤
R10 = ⎢ 1 0
⎣ xˆ1 ⋅ yˆ 0 yˆ1 ⋅ yˆ 0 ⎥⎦
⎡ ⎛ π ⎞⎤
⎢ xˆ1 xˆ0 cosθ yˆ1 xˆ0 cos ⎜ θ + ⎟ ⎥
⎝ 2 ⎠ ⎡ cosθ − sin θ ⎤
=⎢ ⎥=⎢
⎢ ⎛π ⎞ ⎥ sin θ cosθ ⎦⎥
⎢ xˆ1 yˆ 0 cos ⎜ − θ ⎟ yˆ1 yˆ 0 cosθ ⎥ ⎣
⎣ ⎝2 ⎠ ⎦ 4
Properties of rotation matrices
• Inverse rotations:
⎡ xˆ ⋅ xˆ yˆ 0 ⋅ xˆ1 ⎤
R01 = ⎢ 0 1
⎣ xˆ0 ⋅ yˆ1 yˆ 0 ⋅ yˆ1 ⎥⎦
⎡ ⎛π ⎞⎤
⎢ xˆ0 xˆ1 cosθ yˆ 0 xˆ1 cos ⎜ − θ ⎟ ⎥
⎝2 ⎠ ⎥ ⎡ cosθ sin θ ⎤
( )
T
=⎢ =⎢ ⎥ = R10
⎢ ⎛ π⎞ ⎥ ⎣ − sin θ cos θ ⎦
⎢ xˆ0 yˆ1 cos ⎜ θ + 2 ⎟ yˆ 0 yˆ1 cos θ ⎥
⎣ ⎝ ⎠ ⎦
6
Properties of rotation matrices
• Summary:
– Columns (rows) of R are mutually orthogonal
– Each column (row) of R is a unit vector
RT = R −1
det ( R ) = 1
• The set of all n x n matrices that have these properties are called
the Special Orthogonal group of order n
R ∈ SO ( n )
3. Inverse: RT = R −1
4. Associativity: ( R1R2 ) R3 = R1 ( R2 R3 )
⇒ Allows us to combine rotations: Rac = Rab Rbc
8
3D rotations
• General 3D rotation:
⎡ xˆ1 ⋅ xˆ0 yˆ1 ⋅ xˆ0 zˆ1 ⋅ xˆ0 ⎤
R10 = ⎢ xˆ1 ⋅ yˆ 0 yˆ1 ⋅ yˆ 0 zˆ1 ⋅ yˆ 0 ⎥ ∈ SO ( 3)
⎢ ⎥
⎢⎣ xˆ1 ⋅ zˆ0 yˆ1 ⋅ zˆ0 zˆ1 ⋅ zˆ0 ⎦⎥
• Special cases
– Basic rotation matrices
⎡1 0 0 ⎤
Rx ,θ ⎢
= 0 cosθ − sin θ ⎥
⎢ ⎥
⎢⎣0 sin θ cosθ ⎥⎦
⎡ cosθ 0 sin θ ⎤ ⎡cosθ − sin θ 0⎤
Ry ,θ =⎢ 0 1 0 ⎥ Rz ,θ = ⎢ sin θ cos θ 0⎥
⎢ ⎥ ⎢ ⎥
⎢⎣ − sin θ 0 cosθ ⎥⎦ ⎣⎢ 0 0 1 ⎦⎥
3. Rotational transformations
⎢ 1 ⎥ ⎢ ˆ
⎢⎣ p ⋅ zˆ0 ⎥⎦ ⎣ ( ux1 + vy1 + wzˆ1 ) ⋅ zˆ0 ⎦
ˆ ⎥
12
Similarity transforms
Similarity transforms
p 0 = R10 p1
p1 = R21 p 2 p 0 = R10 R21 p 2 R20 = R10 R21
p 0 = R20 p 2
• This defines the composition law for successive rotations about the
current reference frame: post-multiplication
15
4. Compositions of rotations
• Ex1: R represents rotation about the current y-axis by φ followed
by θ about the current z-axis
R = Ry ,φ Rz ,θ
⎡ cos φ 0 sin ϕ ⎤ ⎡ cos θ − sin θ 0 ⎤ ⎡ cos φ cosθ − cos φ sin θ sin φ ⎤
=⎢ 0 1 0 ⎥ ⎢ sin θ cos θ 0 ⎥ = ⎢ sin θ cos θ 0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢⎣ − sin φ 0 cos φ ⎥⎦ ⎢⎣ 0 0 1 ⎥⎦ ⎢⎣ − sin φ cosθ sin φ sin θ cos φ ⎥⎦
( )
R20 = R10 ⎡ R10 RR10 ⎤ = RR10
−1
⎢⎣ ⎦⎥
• This defines the composition law for successive rotations about a
fixed reference frame: pre-multiplication
17
4. Compositions of rotations
18
4. Compositions of rotations
• Summary:
– Consecutive rotations w/ respect to the current reference frame:
• Post-multiplying by successive rotation matrices
– w/ respect to a fixed reference frame (o0)
• Pre-multiplying by successive rotation matrices
– We have hybrid compositions of rotations w/ respect to the
current and a fixed frame using these same rules. Ex: R = ? if:
19
5. Parameterizing rotations
20
5. Parameterizing rotations
• Euler angles
– Rotation by φ about the z-axis, followed by θ about the current
y-axis, then ψ about the current z-axis
⎡ cφ − sφ 0 ⎤ ⎡ cθ 0 sθ ⎤ ⎡ cψ − sψ 0⎤
RZYZ = Rz ,φ Ry ,θ Rz ,ψ = ⎢ sφ cφ 0⎥ ⎢ 0 1 0 ⎥ ⎢ sψ cψ 0⎥
⎢ ⎥⎢ ⎥⎢ ⎥
⎢⎣ 0 0 1 ⎥⎦ ⎢⎣ − sθ 0 cθ ⎦⎥ ⎢⎣ 0 0 1 ⎥⎦
21
5. Parameterizing rotations
• Euler angles
– Rotation by φ about the z-axis, followed by θ about the current
y-axis, then ψ about the current z-axis:
⎡ cφ cθ cψ − sφ sψ −cφ cθ sψ − sϕ cψ cφ sθ ⎤
⎢ ⎥
RZYZ = Rz ,φ Ry ,θ Rz ,ψ = ⎢ sφ cθ cψ + cφ sψ − sφ cθ sψ + cϕ cψ sφ sθ ⎥
⎢ − sθ cψ sθ sψ cθ ⎥⎦
⎣
( ) (
θ = atan2 r33 , 1 − r332 , or θ = atan2 r33 , − 1 − r332 )
• If sin(θ ) > 0:
φ = atan2 ( r13 , r23 ) , ψ = atan2 ( −r31 , r32 )
• If sin(θ ) < 0:
φ = atan2 ( −r13 , −r23 ) , ψ = atan2 ( r31 , −r32 )
22
5. Parameterizing rotations
• Euler angles
– We have only discussed ZYZ Euler angles. What is the set of
all possible Euler angles that can be used to represent any
rotation matrix?
– XYZ, YZX, ZXY, XYX, YZY, ZXZ, XZY, YXZ, ZYX, XZX, YXY
– ZZY cannot be used to describe any arbitrary rotation matrix
since two consecutive rotations about the Z axis can be
composed into one rotation
23
5. Parameterizing rotations
RXYZ = Rz ,φ Ry ,θ Rx ,ψ
⎡ cφ − sφ 0 ⎤ ⎡ cθ 0 sθ ⎤ ⎡1 0 0 ⎤
⎢ ⎥
= ⎢ sφ cφ 0⎥ ⎢ 0 1 0 ⎥ ⎢0 cψ − sψ ⎥
⎢ ⎥⎢ ⎥
⎢⎣ 0 0 1 ⎥⎦ ⎢⎣ − sθ 0 cθ ⎥⎦ ⎢⎣0 sψ cψ ⎥⎦
⎡ cφ cθ − sφ cψ + cφ sθ sψ sφ sψ + cφ sθ cψ ⎤
⎢ ⎥
= ⎢ sφ cθ cφ cψ + sφ sθ sψ −cφ sψ + sφ sθ cψ ⎥
⎢ − sθ cθ sψ cθ cψ ⎥
⎣ ⎦
24
5. Parameterizing rotations
• Axis/Angle representation
– Any rotation matrix in SO(3) can be represented as a single
rotation about a suitable axis through a set angle ⎡kx ⎤
– For example, assume that we have a unit vector: kˆ = ⎢ k y ⎥
⎢ ⎥
– Given θ, we want to derive Rk,θ: ⎢⎣ k z ⎥⎦
• Intermediate step: project the z-axis
onto k:
Rk ,θ = RRz ,θ R −1
25
5. Parameterizing rotations
• Axis/Angle representation
– This is given by:
⎡ k x2 vθ + cθ k x k y vθ − k z sθ k x k z vθ + k y sθ ⎤
⎢ ⎥
Rk ,θ = ⎢ k x k y vθ + k z sθ k y2 vθ + cθ k y k z vθ − k x sθ ⎥
⎢ ⎥
⎢⎣ k x k z vθ − k y sθ k y k z vθ + k x sθ k z2 vθ + cθ ⎥⎦
6. Rigid motions
⎣1⎦ ⎣1⎦
• The matrix multiplication H is known as a homogeneous transform
and we note that H ∈ SE ( 3)
• Inverse transforms:
⎡ RT − RT d ⎤
H −1 = ⎢ ⎥
⎣0 1 ⎦
29
7. Homogeneous transforms
• Basic transforms: Three pure translation, three pure rotation
⎡1 0 0 a⎤ ⎡1 0 0 0⎤
⎢0 1 0 0⎥ ⎢0 c − s 0⎥
Trans x ,a =⎢ ⎥ Rot x ,α =⎢ α α ⎥
⎢0 0 1 0⎥ ⎢0 sα cα 0⎥
⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣0 0 0 1⎦
⎡1 0 0 0⎤ ⎡ cβ 0 sβ 0⎤
⎢0 1 0 b⎥ ⎢ 0 1 0 0⎥
Trans y ,b =⎢ ⎥ Rot y ,β =⎢ ⎥
⎢0 0 1 0⎥ ⎢ − sβ 0 cβ 0⎥
⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣ 0 0 0 1⎦
⎡1 0 0 0⎤ ⎡cγ − sγ 0 0⎤
⎢0 1 0 0⎥ ⎢s cγ 0 0⎥
Trans z ,c =⎢ ⎥ Rot z ,γ =⎢ γ ⎥
⎢0 0 1 c⎥ ⎢0 0 1 0⎥
⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣0 0 0 1⎦
30
7. Homogeneous transforms
• Ex: Compute the homogeneous transformation representing a
translation of 3 units along the x-axis followed by a rotation of π/2
about the current z-axis followed by a translation of 1 unit along the
fixed y-axis
T = Trans y ,1.Trans x ,3 .Rot z ,π /2
⎡1 0 0 0 ⎤ ⎡1 0 0 3⎤ ⎡0 −1 0 0⎤
⎢0 1 0 1 ⎥ ⎢0 1 0 0 ⎥ ⎢1 0 0 0⎥
=⎢ ⎥⎢ ⎥⎢ ⎥
⎢0 0 1 0 ⎥ ⎢0 0 1 0⎥ ⎢0 0 1 0⎥
⎢ ⎥⎢ ⎥⎢ ⎥
⎣0 0 0 1 ⎦ ⎣0 0 0 1 ⎦ ⎣0 0 0 1⎦
⎡1 −1 0 3⎤
⎢1 0 0 1⎥
=⎢ ⎥
⎢0 0 1 0⎥
⎢ ⎥
⎣0 0 0 1⎦
31