Documente Academic
Documente Profesional
Documente Cultură
t
P
2D Translation Equation
P’
t
ty P P ( x, y )
y t (t x , t y )
x tx
P' ( x t x , y t y ) Pt
2D Translation using Matrices
P’ P ( x, y )
t
ty P
t (t x , t y )
y
t P
x tx x
x t x 1 0 t x
P' y
y t y 0 1 t y 1
Scaling
P’
P
Scaling Equation
P’
s.y
P ( x, y )
P P' ( sx, sy )
y
P' s P
x s.x
sx s 0 x
P'
sy 0 s y
P' S P S
Rotation
P
P’
Rotation Equations
Counter-clockwise rotation by an angle
R RT RT R I
det( R) 1
Transformations can be
composed
• Matrix multiplication is associative.
• Combine series of transformations into
one matrix. (example, whiteboard).
• In general, the order matters. (example,
whiteboard).
• 2D Rotations can be interchanged.
Why?
Rotation and Translation
x
( cos -sin tx
sin cos ty
)( ) y
1
0 0 1
(
a
b
-b
a
tx
ty )( ) y
1
0 0 1
Rotation about an arbitrary point
P sx x sx 0 x
P'
y s y 0 sy y
y
x Sx.x S
P' S P
Stretching = tilting and projecting
(with weak perspective)
sx
sx x sx 0 x s 0 x
P'
s y y y y
s
s y 0 y
y
0 1
SVD
• For any matrix, M = R1DR2
– R1, R2 are rotation matrices
– D is a diagonal matrix.
– This decomposition is unique.
– Efficient algorithms can compute this (in
matlab, svd).
Linear Transformation
a b x
P'
c d y SVD
x
a b tx
P' y
c d ty 1
Simple 3D Rotation
cos sin 0 x x . . . x
1 2 n
sin cos 0 y 1
y 2
y n
0
0 1 z1
z 2
z
n
Rotation about z axis.
Rotates x,y coordinates. Leaves z coordinates fixed.
Full 3D Rotation
cos sin 0 cos 0 sin 1 0 0
R sin cos 0 0 1 0 0 cos sin
0 1 sin 0 cos 0 sin cos
0