Two-Dimensional Geometric
Transformations
• Basic Transformations
• Translation
• Rotation
• Scaling
• Composite Transformations
• Other transformations
• Reflection
• Shear
07/09/25 1
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
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
Rotation
 Pivot point
x
y
P(x,y)
P’ (x’,y’)
r
(xr,yr)
x’=xr+(x- xr)cos θ -(y- yr)sin θ
y’=yr+(x- xr)sin θ +(y- yr)cos θ
θ
Φ
07/09/25 4
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
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
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
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
Composite Transformations
 Translations


































1
0
0
1
0
0
1
1
0
0
1
0
0
1
1
0
0
1
0
0
1
2
1
2
1
1
1
2
2
y
y
x
x
y
x
y
x
t
t
t
t
t
t
t
t
}
)
,
(
{
)
,
( 1
1
2
2
'
P
t
t
T
t
t
T
P y
x
y
x 


P
t
t
T
t
t
T y
x
y
x 

 )}
,
(
)
,
(
{ 1
1
2
2
)
,
(
)
,
(
)
,
( 2
1
2
1
1
1
2
2 y
y
x
x
y
x
y
x t
t
t
t
T
t
t
T
t
t
T 



07/09/25 9
Composite Transformations
 Scaling


































1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
2
1
2
1
1
1
2
2
y
y
x
x
y
x
y
x
s
s
s
s
s
s
s
s
)
,
(
)
,
(
)
,
( 2
1
2
1
1
1
2
2 y
y
x
x
y
x
y
x s
s
s
s
S
s
s
S
s
s
S 



07/09/25 10
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
General Pivot-Point Rotation
• Rotations about any selected pivot point (xr,yr)
• Translate-rotate-translate
07/09/25 12
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
General Fixed-Point Scaling
Scaling with respect to a selected fixed position (xf,yf)
07/09/25 14
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
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
General Scaling Directions
07/09/25 17
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
Concatenation Properties
 Reversing the order
 A sequence of transformations is performed may affect
the transformed position of an object.
07/09/25 19
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
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
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
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
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
Reflection
 Reflection about the x axis
07/09/25 25
Reflection
 Reflection about the y axis
07/09/25 26
Reflection
 Reflection relative to the coordinate origin
07/09/25 27
Reflection
 Reflection of an object relative to an axis perpendicular to
the xy plane through Prfl
07/09/25 28
Reflection
 Reflection about the line y = x
07/09/25 29
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
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
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
Transformations between
Coordinate Systems
x
y
y’
x’
x0
y0
θ
x
y
y’
x’
θ
07/09/25 33
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

Two dimensional_Transformations Notes.ppt