2. Translation
• Translation transformation
• Translation vector or shift vector T = (tx, ty)
• Rigid-body transformation
• Moves objects without deformation
x
t
x
x
'
y
t
y
y
'
x
y
p
P’
T
x
y
T
07/09/25 2
3. Rotation
Rotation transformation
x
y
P(x,y)
P’ (x’,y’)
r
θ
Φ
x’=rcos(Φ+θ)= rcos Φ cos θ -rsin Φ sin θ
y’=rsin(Φ+θ)= rcos Φ sin θ+rsin Φ cos θ
x=rcos Φ y=rsin Φ
x’=x cos θ -ysin θ
y’=xsin θ +ycos θ
P’= R· P
cos
sin
sin
cos
R
07/09/25 3
5. Scaling
Scaling transformation
Scaling factors, sx and sy
Uniform scaling
x
s
x
x
'
y
s
y
y
'
y
x
s
s
y
x
y
x
0
0
'
'
P
S
P
'
x
y
x
y
2
x
s
1
y
s
07/09/25 5
6. Scaling
Fixed point
x
f
f s
x
x
x
x
)
(
'
y
f
f s
y
y
y
y
)
(
'
)
1
(
'
x
f
x s
x
s
x
x
)
1
(
'
y
f
y s
y
s
y
y
07/09/25 6
7. Matrix Representations and
Homogeneous Coordinates
• Homogeneous Coordinates
• Matrix representations
• Translation
)
,
,
(
)
,
( h
y
x
y
x h
h
h
x
x h
h
y
y h
1
1
0
0
1
0
0
1
1
'
'
y
x
t
t
y
x
y
x
07/09/25 7
8. Matrix Representations
Matrix representations
Scaling
Rotation
1
1
0
0
0
0
0
0
1
'
'
y
x
s
s
y
x
y
x
1
1
0
0
0
cos
sin
0
sin
cos
1
'
'
y
x
y
x
07/09/25
8
11. Composite Transformations
Rotations
}
)
(
{
)
( 1
2
'
P
R
R
P
P
R
R
)}
(
)
(
{ 1
2
)
(
)
(
)
( 2
1
1
2
R
R
R
1
0
0
0
)
cos(
)
sin(
0
)
sin(
)
cos(
1
0
0
0
cos
sin
0
sin
cos
1
0
0
0
cos
sin
0
sin
cos
2
1
2
1
2
1
2
1
1
1
1
1
2
2
2
2
07/09/25 11
12. General Pivot-Point Rotation
• Rotations about any selected pivot point (xr,yr)
• Translate-rotate-translate
07/09/25 12
13. General Pivot-Point Rotation
1
0
0
1
0
0
1
1
0
0
0
cos
sin
0
sin
cos
1
0
0
1
0
0
1
r
r
r
r
y
x
y
x
1
0
0
sin
)
cos
1
(
cos
sin
sin
)
cos
1
(
sin
cos
r
r
r
r
x
y
y
x
)
,
,
(
)
,
(
)
(
)
,
(
r
r
r
r
r
r y
x
R
y
x
T
R
y
x
T
07/09/25 13
15. General Fixed-Point Scaling
Translate-scale-translate
1
0
0
1
0
0
1
1
0
0
0
0
0
0
1
0
0
1
0
0
1
r
r
y
x
r
r
y
x
s
s
y
x
1
0
0
)
1
(
0
)
1
(
0
y
f
y
x
f
x
s
y
s
s
x
s
)
,
,
,
(
)
,
(
)
,
(
)
,
( r
r
f
f
f
f
y
x
f
f y
x
y
x
S
y
x
T
s
s
S
y
x
T
07/09/25 15
16. General Scaling Directions
Scaling factors sx and sy scale objects along the x and y
directions.
We scale an object in other directions with scaling
factors s1 and s2
07/09/25 16
18. Concatenation Properties
Matrix multiplication is associative.
A·B ·C = (A·B )·C = A·(B ·C)
Transformation products may not be commutative
Be careful about the order in which the composite matrix
is evaluated.
Except for some special cases:
Two successive rotations
Two successive translations
Two successive scalings
rotation and uniform scaling
07/09/25 18
19. Concatenation Properties
Reversing the order
A sequence of transformations is performed may affect
the transformed position of an object.
07/09/25 19
20. General Composite Transformations and
Computer Efficiency
A general two-dimensional transformation
Rotation-scaling terms rsij
Translational terms trsx and trsy
Minimum number of computations
Four multiplications
Four additions
1
1
0
0
1
'
'
y
x
trs
rs
rs
trs
rs
rs
y
x
y
yy
yx
x
xy
xx
x
xy
xx trs
rs
y
rs
x
x
'
y
yy
yx trs
rs
y
rs
x
y
'
07/09/25 20
21. Rigid-Body Transformation
Rigid-body transformation matrix
The upper-left 2-by-2 submatrix is an orthogonal matrix
Two vectors (rxx, rxy) and (ryx, ryy) form an orthogonal set of unit
vectors.
1
0
0
y
yy
yx
x
xy
xx
tr
r
r
tr
r
r
Multiplicative rotation terms rij
Translational terms trx and try
1
2
2
2
2
yy
yx
xy
xx r
r
r
r
0
yy
xy
yx
xx r
r
r
r
07/09/25 21
22. Rigid-Body Transformation
The orthogonal property of rotation matrices
We know the final orientation of an object
Construct the desired transformation by assigning the elements of u’ to
the first row of the rotation matrix and the elements of v’ to the second
row.
07/09/25 22
23. Computational Efficiency
Use approximations and iterative calculations to
reduce computations
Approximate the trigonometric functions based on the
first few terms of their power-series expansions.
For small enough angles (< 100
), cos is approximately
1.sin is approximately
Accumulated error control
Estimate the error in x’ and y’ at each step
Reset object positions when the error accumulation becomes too
great
07/09/25 23
24. Reflection
A transformation produces a mirror image of an object.
Axis of reflection
A line in the xy plane
A line perpendicular to the xy plane
The mirror image is obtained by rotating the object 1800
about
the reflection axis.
Rotation path
Axis in xy plane: in a plane perpendicular to the xy plane.
Axis perpendicular to xy plane: in the xy plane.
07/09/25 24
30. Shear
The x-direction shear relative to x axis
1
0
0
0
1
0
0
1 x
sh y
sh
x
x x
'
y
y
'
If shx = 2:
07/09/25 30
31. Shear
The x-direction shear relative to y = yref
1
0
0
0
1
0
1 ref
x
x y
sh
sh )
(
'
ref
x y
y
sh
x
x
y
y
'
If shx = ½ yref = -1:
1 1/2 3/2
07/09/25 31
32. Shear
The y-direction shear relative to x = xref
1
0
0
1
0
0
1
ref
y
y x
sh
sh
x
x
'
y
x
x
sh
y ref
y
)
(
'
If shy = ½ xref = -1:
1
1/2
3/2
07/09/25 32
34. Transformations between
Coordinate Systems
1
0
0
1
0
0
1
)
,
( 0
0
0
0 y
x
y
x
T
1
0
0
0
cos
sin
0
sin
cos
)
(
R
)
,
(
)
( 0
0
'
'
, y
x
T
R
M y
x
xy
Method 1:
Method 2:
)
,
( y
x v
v
V
V
v
)
,
(
)
,
( y
x
x
y u
u
v
v
u
1
0
0
0
0
y
x
y
x
v
v
u
u
R
07/09/25 34