Scalar Product: av , Change only the length “scaling”, but keep direction fixed.. Sneak peek: matrix operation Av can change length,... ❑ Matrix multiplication AB: apply transformatio
Trang 1Shivkumar Kalyanaraman
Linear Algebra
A gentle introduction
Linear Algebra has become as basic and as applicable
as calculus, and fortunately it is easier.
Gilbert Strang, MIT
Trang 2What is a Vector ?
❑ Think of a vector as a directed line segment in N-dimensions! (has
“length” and “direction”)
❑ Basic idea: convert geometry in higher dimensions into algebra!
❑ Once you define a “nice” basis along
each dimension: x-, y-, z-axis …
❑ Vector becomes a 1 x N matrix!
❑ v = [a b c]T
❑ Geometry starts to become linear
algebra on vectors like v!
a
y
v
Trang 3Shivkumar Kalyanaraman
A
B A
B
C
A+B = C (use the head-to-tail method
to combine vectors)
A+B
Trang 4Scalar Product: av
) ,
( )
Change only the length (“scaling”), but keep direction fixed.
Sneak peek: matrix operation (Av) can change length,
Trang 5B A B
Trang 6Inner (dot) Product: v.w or w T v
v
w
α
2 2
1 1 2
1 2
(
The inner product is a
The inner product is a SCALAR! SCALAR!
).(
, (
w v
w
v = 0 ⇔ ⊥
Trang 7Shivkumar Kalyanaraman
Bases & Orthonormal Bases
❑ Basis (or axes): frame of reference
vs
Basis: a space is totally defined by a set of vectors – any point is a linear
combination of the basis
Ortho-Normal: orthogonal + normal
z x
y x
[ ] [ ] [ ]T
T T
z y x
1 0 0
0 1 0
0 0 1
=
=
=
Trang 8b a
rows
columns
Trang 9Shivkumar Kalyanaraman
Basic Matrix Operations
❑ Addition, Subtraction, Multiplication: creating new matrices (or functions)
g c
f b
e
a h
g
f
e d
g c
f b
e
a h
g
f
e d
dg ce
bh af
bg
ae h
g
f
e d
c
b
a
Just add elements
Just subtract elements
Multiply each row
by each column
Trang 10Matrix Times Matrix
N M
31
23 22
21
13 12
11
33 32
31
23 22
21
13 12
11
33 32
31
23 22
21
13 12
11
n n
n
n n
n
n n
n
m m
m
m m
m
m m
m
l l
l
l l
l
l l
l
32 13 22
12 12
11
Trang 11Shivkumar Kalyanaraman
Multiplication
❑ Is AB = BA? Maybe, but maybe not!
❑ Matrix multiplication AB: apply transformation B first, and then again transform using A!
❑ Heads up: multiplication is NOT commutative!
❑ Note: If A and B both represent either pure “rotation” or “scaling” they can be interchanged (i.e AB = BA)
g
f
e d
c
b
a h g
f e
Trang 12Matrix operating on vectors
❑ Matrix is like a function that transforms the vectors on a plane
❑ Matrix operating on a general point => transforms x- and y-components
❑ System of linear equations: matrix is just the bunch of coeffs !
Trang 13Shivkumar Kalyanaraman
Direction Vector Dot Matrix
c b
Trang 14Matrices: 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!
Trang 17Shivkumar Kalyanaraman
2D Translation
t P
P’
t P
P ' = ( x + tx, y + ty) = +
Pyty
P’
t
Trang 180 1
0
0 0
1
I
Trang 19Shivkumar Kalyanaraman
Determinant of a Matrix
❑ Used for inversion
❑ If det(A) = 0, then A has no inverse
b
d bc
ad
A 1 1
http://www.euclideanspace.com/maths/algebra/matrix/functi
ons/inverse/threeD/index.htm
Trang 20Projection: Using Inner Products (I)
Trang 21Shivkumar Kalyanaraman
Homogeneous Coordinates
❑ Represent coordinates as (x,y,h)
❑ Actual coordinates drawn will be (x/h,y/h)
Trang 23Shivkumar Kalyanaraman
Homogeneous Transformations
1 0
0
0
1
1 1
0 0
0 1
3 3
3 3
2 2
2 2
1 1
1 1
3 3
3 3
2 2
2 2
1 1
1 1
+ +
+
=
+ +
+
=
′
+ +
+
=
′
+ +
x
z y
x z
z y
x y
z y
x x
z y x
z
y
x
v v
v
d v
c v
b v
a v
d v
c v
b v
a v
d v
c v
b v
a v
v v
v
d c
b a
d c
b a
d c
b a
v
v
v
v M v
Trang 24Order 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
Trang 25Shivkumar KalyanaramanRensselaer Polytechnic Institute
Trang 26Vectors: Cross Product
perpendicular to A and B
A and B
in a right-handed coordinate system
) sin( θ
B A
B
B A×B
Trang 27Shivkumar Kalyanaraman
MAGNITUDE OF THE CROSS
PRODUCT
Trang 28DIRECTION OF THE CROSS
PRODUCT
❑ The right hand rule determines the direction of the cross product
Trang 29Shivkumar Kalyanaraman
For more details
❑ Prof Gilbert Strang’s course videos: