Overview of the lecture
●
Matrices
●
Matrix algebra
●
Vectors
●
Homogeneous coordinates
●
Transformations in homogeneous coordinates
Matrices
Matrix is an array of numbers












−
−
05565
08707
43601
1341
Matrices
Matrix is an array of numbers










−−
−
−−
3.81109.09.0
1.951.33.90
84.119.02.3
Matrices
Matrix is an array of numbers










3231
2221
1211
aa
aa
aa
Matrices
Matrix is an array of numbers
















−
5.0
2.9
8.7
2.1
5.0
Terminology
A row of the matrix












−
−
05565
08707
43601
1341
Terminology
A column of the matrix












−
−
05565
08707
43601
1341
Terminology
An element of the matrix












−
−
05565
08707
43601
1341
Terminology
If a matrix has m rows and n columns we say that its
dimension is m x n.
The dimension of this matrix is 3 x 5










−−
−
−−
3.81109.09.0
1.951.33.90
84.119.02.3
Addition
The addition of matrices is component-wise.
The two matrices must have the same dimension.






++
++
=





+





22222121
12121111
2221
1211
2221
1211
baba
baba
bb
bb
aa
aa
Addition
Example 2.1:






=





+





111
63
90
31
21
32
Multiplication by scalar
The multiplication of a matrix by a scalar
(by a number) is again component-wise.






⋅⋅
⋅⋅
=





⋅
2221
1211
2221
1211
acac
acac
aa
aa
c
Multiplication by scalar
Example 2.2:






=





⋅
60
213
20
71
3
Let A be a n x m matrix and let B be a m x k matrix.
Then A*B is a n x k matrix
Matrix multiplication












=
























nknn
k
k
mkmm
k
k
nmnn
m
m
ccc
ccc
ccc
bbb
bbb
bbb
aaa
aaa
aaa












21
22221
11211
21
22221
11211
21
22221
11211
∑=
=
m
l
ljilij bac
1
Matrix multiplication
Example 2.3:










=



















 15
113
011
200
210
125
431
Matrix multiplication
Example 2.3:










=



















 715
113
011
200
210
125
431
Matrix multiplication
Example 2.3:










=



















 6715
113
011
200
210
125
431
Matrix multiplication
Example 2.3:










=




















5
6715
113
011
200
210
125
431
Matrix multiplication
Example 2.3:










=




















237
1135
6715
113
011
200
210
125
431
Short review of matrices
Elementary transformations (keep order and rank)
1-Swap
(Interchange)
)()( jrowirowRij ⇔=
)()( jcolumnicolumnCij ⇔=
2-Multiply
)(.)( irowkirowkRi ⇔=
0k ≠
)(.)( icolumnkicolumnkCi ⇔=
3-addition 0k ≠
)(.)()( jrowkirowirowkRR ji +⇔=+
)(.)()( jcolumnkicolumnicolumnkCC ji +⇔=+
Rank of Matrices.
• It is the number of nonzero rows of the
echelon form.
Short review of matrices
Transpose
Rows and columns of an mXn matrix are interchanged
To form the nXm matrix












=
434241
333231
232221
131211
aaa
aaa
aaa
aaa
A










=
43332313
42322212
41312111
aaaa
aaaa
aaaa
'A
'B'A)'BA( +=+ 'A'B)'AB( =
Short review of matrices
Null matrix: O A0OAAO ∀==
Orthogonal matrix I'AAA'A ==






θθ
θ−θ
=
)(Cos)(Sin
)(Sin)(Cos
A






θθ−
θθ
=
)(Cos)(Sin
)(Sin)(Cos
'A






=
10
01
'AA
• Homogeneous equations: AX=0
1. unique solution
2. Infinite solution
• Nonhomogeneous equations: AX=B
1. No solution
2. unique solution
3. Infinite solution
Overview of the lecture
●
Matrices
●
Matrix algebra
●
Vectors
●
Homogeneous coordinates
●
Transformations in homogeneous coordinates
Vectors
A column vector is a n x 1 matrix
A row vector is a 1 x n matrix












1
21
11
na
a
a

[ ]naaa 11211 
Vectors
The point (x , y , z) of the 3D space can be written as
a column vector
or a row vector










z
y
x
[ ]zyx
Vectors
Example 2.4:










=




















3
0
1
210
125
431
Vectors
Example 2.4:










=



















 13
3
0
1
210
125
431
Vectors
Example 2.4:










=




















8
13
3
0
1
210
125
431
Vectors
Example 2.4:










=




















6
8
13
3
0
1
210
125
431
Applications of matrices
• Solutions of simultaneous linear
Homogeneous and Nonhomogeneous
equations.
• Linear dependence and independence
• Balancing the chemical reactions.
• Determine the current in the circuit.
• Array used in programming.
• Matrix transformations are used in
computer graphics (CAD).
• Store the data.
• Cryptography (Secrete writing).
• New view of complex number.
Applications of matrices
Overview of the lecture
●
Matrices
●
Matrix algebra
●
Vectors
●
Homogeneous coordinates
●
Transformations in homogeneous coordinates
Homogenous coordinates
• Why don’t we stick with the usual (Cartesian)
coordinates ?
• In the previous lecture, we noticed that the equations of
the translation are not (can not) be described by a
multiplication by a 3x3 matrix.
• A unified matrix description of translation, rotation,
scaling (and other transformations we do not cover
here) requires the use of 4x4 matrices.
• This uniformity is especially useful when we want to
compute combinations of transformations.
• In the beginning, it is difficult to appreciate the
advantages of homogenous coordinates, but they are a
standard in graphics programming.
Homogeneous coordinates
A point of the 3D space
is written in homogeneous coordinates as










z
y
x












⋅
⋅
⋅
w
zw
yw
xw
0≠w
Homogeneous coordinates
Notice that the homogenous coordinates of a 3D point are
not unique.
In many applications it is sufficient (and convenient) to fix
w = 1, in which
case the homogenous coordinates become












1
z
y
x
Overview of the lecture
●
Matrices
●
Matrix algebra
●
Vectors
●
Homogeneous coordinates
●
Transformations in homogeneous coordinates
Transformations in
homogeneous coordinates
• Translation
• Rotation
• Scaling
Translation
A translation moves
the object along a
vector
),,, 1( 000 zyx
)1,0,0,0(
x
z
y
Translation
In homogeneous coordinates the translation by
has equation
),,( 000 zyx












=
























1
'
'
'
11000
100
010
001
0
0
0
z
y
x
z
y
x
z
y
x
Rotation
Rotation
In homogeneous coordinates, the rotation through θ
along the x-axis is given by












=
























−
1
'
'
'
11000
0cossin0
0sincos0
0001
z
y
x
z
y
x
θθ
θθ
Rotation
the equation of the rotation through θ along the y-axis is












=
























−
1
'
'
'
11000
0cos0sin
0010
0sin0cos
z
y
x
z
y
x
θθ
θθ
Rotation
the equation of the rotation through θ along the z-axis is












=























 −
1
'
'
'
11000
0100
00cossin
00sincos
z
y
x
z
y
x
θθ
θθ
Scaling
The equation of the uniform scaling by s is
Uniform scaling












=
























1
'
'
'
11000
000
000
000
z
y
x
z
y
x
s
s
s
Scaling
The general equation of the scaling is
General scaling












=
























1
'
'
'
11000
000
000
000
3
2
1
z
y
x
z
y
x
s
s
s
Discussion
• Translations and rotations are the most common transformations of 3D
space.
• They do not alter the shape of an object, but only change its position in
space.
• The distance between two points is the same before and after a
translation or rotation.
• In a mathematical language, we say that translations and rotations
are isometries.
• Translations and rotations preserve the orientation of an object.
Discussion
An example of a non-orientation preserving isometry is the reflection.
Matrices

Matrices