Professional Documents
Culture Documents
Linear Algebra
Linear Algebra
x1
Tim Cootes Transpose:
x2
x= xT = (x1 x2 ... xn )
:
x
n
• In 2D:
a
a2 a = a12 + a22
a1
1
Inner (“dot”) Product Properties of the Inner product
a
• Dot product of two vectors is the sum of the a.b = a b cosθ θ
products of matching elements: b
n
Where θ is the angle between th e vectors
a.b = ∑ aibi = a1b1 + a 2b2 + ...+ an bn Since -1 ≤ cos? ≤ 1
i =1
− a b ≤ a.b ≤ a b
• Vectors must have the same number of
elements If a.b = a b thena and b are parallel (? = 0)
If a.b = 0 thena and b are orthogonal (? = 90o )
2
Matrix Arithmetic Matrix Multiplication
sa11 sa12 ... sa1 n
Ab = c
sa 21 sa22 ... sa2 n
sA =
:
a11 a12 ... a1n b1 c1 a11b1 + a12b2 + ... + a1n bn
: :
∑ i=1 a 2ibi
n
sa
m1 sam 2 ... samn
a 21 a 22 ... a2 n b2 c2
= =
: : : : : :
a11 + b11 a12 + b12 ... a1n + b1n
a ... a mn bn cm ∑i =1 mi i
n
m1 m2a a b
a21 + b21 a 22 + b22 ... a2 n + b2 n
Size : ( m x n ) x ( n x 1) = ( m x 1)
A +B =
: : :
a +b + ... amn + bmn
j-th element of c given by sum of products
m1 m 1 m 2 bm 2
a of j-th row of A with elements of b
c j = ∑i =1 a jibi
n
2D Examples 2D Examples
s 0 a b 1 a a b 0 c
sI = applies a scalingof s = =
0 s c d 0 b c d 1 d
0 − 1 x − y
1 0 y = x
0 −1
applies a rotationof 90 o a b
x → x
b
d
1 0 x 0 c d
1 a
y c
cosθ − sin θ −y x
sin θ cosθ
applies a rotation of θ 1
0
x
s 0 y s 0 x sx
=
applies a shear along x 0
1 y y
0 1
3
2D Examples Geometric Representation
a 0 0
x → x
0 0 b b • Every 2 x 2 matrix can be decomposed into a combination
1
of rotations, scaling and shears
• Every n x n matrix can be decomposed into a combination
1 a of n-dimensional scalings, rotations and shears.
0
0
cosθ − sin θ
x → x
0 sin θ cosθ
1
θ
1
0
Sizes: (n x m)(m x p) = (n x p)
4
Unit (“Orthonormal”) Matrices 2D Unit Matrices
• If U is a square matrix such that • 2D unit matrices have the form
U = 1 and U U = I
T
cosθ − sinθ
U =
then U is a “Unit” or “Orthonormal” matrix sin θ cosθ
M = UDU T
Pure rotation Inverse of rotation
Pure scaling along each axis
Determinants of symmetric
Eigenvectors
matrices
• The columns of the rotation matrix are the “Eigen- • If M is symmetric,
vectors” of M
• The elements of the diagonal matrix are the M = UDU T = U D UT = 1. D . 1 = d1d 2...d n
“ eigenvalues” of M