Professional Documents
Culture Documents
Linear Algebra - Universi
Linear Algebra - Universi
Linear Algebra - Universi
A gentle introduction
A
A+B = C
(use the head-to-tail method
B to combine vectors)
C
B
av a ( x1 , x2 ) (ax1 , ax2 )
av
v
2
A AT A aa bb cc The magnitude is the dot
product of a vector with itself
v
w v.w ( x1 , x2 ).( y1 , y2 ) x1 y1 x2 . y2
v.w 0 v w
If vectors v, w are “columns”, then dot product is wTv
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
6 : “shiv rpi”
Bases & Orthonormal Bases
Basis (or axes): frame of reference
vs
y 0 1 0 xz 0
T
[Sneak peek:
Orthogonal: dot product is zero
Normal: magnitude is one ] z 0 0 1 T
yz 0
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
7 : “shiv rpi”
What is a Matrix?
A matrix is a set of elements, organized into rows and
columns
rows
a b
columns
c d
a b e f a e b f
c d g
h c g d h
Just add elements
a b e f a e b f
c d g
h c g d h
Just subtract elements
a b e f ae bg af bh Multiply each row
c d g
h ce dg cf dh by each column
L MN
a b x x'
x’ = ax + by
y’ = cx + dy
c d y y'
ax bx cx d x vx
a by cy d y v y
v M v y
az bz cz d z vz
0 0 0 1 1
vx vx ax v y bx vz cx
vy vx a y v y by vz c y v v x a v y b v z c
vz vx az v y bz vz cz
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
13 : “shiv rpi”
Matrices: Scaling, Rotation, Identity
Pure scaling, no rotation => “diagonal matrix” (note: x-, y-axes could be scaled differently!)
Pure rotation, no stretching => “orthogonal matrix” O
Identity (“do nothing”) matrix = unit scaling, no rotation!
r1 0
0 r2
[0,1]T [0,r2]T
scaling
[1,0]T [r1,0]T
cos -sin
sin cos
[-sin, cos]T
[0,1]T
[cos, sin]T
rotation
[1,0]T
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
14 : “shiv rpi”
Scaling
P’
P’
cos -sin
sin cos
t
P
P’
P ' ( x t x , y t y ) Pt t
ty
P
y
1 0 0
matrices that are non-singular
Maps N-d space to another
N-d space bijectively
Some matrices have an
I 0 1 0
inverse, such that:
AA-1 = I
Inversion is tricky: 0 0 1
(ABC)-1 = C-1B-1A-1
Derived from non-
commutativity property
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
18 : “shiv rpi”
Determinant of a Matrix
Used for inversion
If det(A) = 0, then A has no inverse
a b
A det( A) ad bc
c d
1 1 d b
A
ad bc c a
http://www.euclideanspace.com/maths/algebra/matrix/functi
ons/inverse/threeD/index.htm
p = a (aTx)
||a|| = aTa = 1
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
20 : “shiv rpi”
Homogeneous Coordinates
Represent coordinates as (x,y,h)
Actual coordinates drawn will be (x/h,y/h)
x’ 1 0 tx x
y’ = 0 1 ty y
1 0 0 1 1
22 : “shiv rpi”
Homogeneous Transformations
v M v
vx a1 d1 v x
b1 c1
v a d 2 v y
b2 c2
y 2
vz a3 b3 c3 d 3 v z
1 0 0 0 1 1
vx a1v x b1v y c1v z d1
vy a2 v x b2 v y c2 v z d 2
vz a3v x b3v y c3v z d 3
1 0v x 0v y 0v z 1
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
23 : “shiv rpi”
Order of Transformations
Note that matrix on the right is the first applied
Mathematically, the following are equivalent
p’ = ABCp = A(B(Cp))
Note many references use column matrices to
represent points. In terms of column matrices
p’T = pTCTBTAT
T R M
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
24 : “shiv2rpi”
Rotation About a Fixed Point other than
the Origin
Move fixed point to origin
Rotate
Move fixed point back
M = T(pf) R() T(-pf)
A×B A B A B sin( )
B
A
Rensselaer Polytechnic Institute Shivkumar Kalyanaraman
26 : “shiv rpi”
MAGNITUDE OF THE CROSS
PRODUCT