Download Matrix Algebra Tutorial

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Quadratic form wikipedia , lookup

System of linear equations wikipedia , lookup

Determinant wikipedia , lookup

Dual space wikipedia , lookup

Jordan normal form wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Tensor operator wikipedia , lookup

Perron–Frobenius theorem wikipedia , lookup

Orthogonal matrix wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Vector space wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Exterior algebra wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Laplace–Runge–Lenz vector wikipedia , lookup

Gaussian elimination wikipedia , lookup

Cross product wikipedia , lookup

Geometric algebra wikipedia , lookup

Euclidean vector wikipedia , lookup

Linear algebra wikipedia , lookup

Basis (linear algebra) wikipedia , lookup

Covariance and contravariance of vectors wikipedia , lookup

Bra–ket notation wikipedia , lookup

Matrix multiplication wikipedia , lookup

Cartesian tensor wikipedia , lookup

Four-vector wikipedia , lookup

Matrix calculus wikipedia , lookup

Transcript
CS 335
Graphics and Multimedia
Matrix Algebra Tutorial
Properties of Vector Cross Product
Cross product of parallel vectors
r
V1 ×V2 = V2 ×V1 = 0
iff V1 parallelto V2
Anti-commutative
V1 ×V2 = −(V2 ×V1 )
Not associative
V1 × (V2 ×V3 ) ≠ (V1 ×V2 ) ×V3
Distributive with respect to vector addition
V1 × (V2 + V3 ) = (V1 ×V2 ) + (V1 ×V3 )
Basic Definitions
„ Scalar – a number
„
e.g. 3.1, 2.9, 10.7e5
„ Vector – a column (or a row) of scalars
⎡a ⎤
3
⎡ ⎤
⎢b ⎥
V = [u , v, s, t ], V = ⎢⎢4⎥⎥, V = ⎢ ⎥
⎢c ⎥
⎢⎣7 ⎥⎦
⎢ ⎥
⎣d ⎦
„ Matrix – an array of numbers (or a collection of
vectors)
⎡3.2 9.4⎤
M =⎢
,
⎥
⎣ 5 7.1⎦
⎡a
N = ⎢⎢ e
⎢⎣ x
b
c
f
g
y
z
d⎤
i ⎥⎥
w⎥⎦
Vector Math
„ Add
⎡ x1 ⎤
⎡ x2 ⎤
V1 = ⎢⎢ y1 ⎥⎥,V2 = ⎢⎢ y2 ⎥⎥
⎢⎣ z1 ⎥⎦
⎢⎣ z2 ⎥⎦
⎡ x1 + x2 ⎤
V1 + V2 = ⎢⎢ y1 + y2 ⎥⎥
⎢⎣ z1 + z2 ⎥⎦
„ Scale
⎡ax⎤
aV = ⎢⎢ay⎥⎥
⎢⎣az⎥⎦
„ Transpose
T
⎡ x⎤
⎢
⎥
T
V = ⎢ y⎥ = [x
⎢⎣ z ⎥⎦
y
z]
Vector Math
„ Dot product
V1 ⋅V2 = V1 V2 cosθ
where θ is the angle
between the two vectors
V2
θ
|V2| cos θ
V1 ⋅ V2 = V1 xV2 x + V1 yV2 y + V1 zV2 z
V1 ⋅ V2 = V2 ⋅ V1 = 0 if and only if V1 ⊥ V2
V1 ⋅ (V2 + V3 ) = V1 ⋅ V2 + V1 ⋅ V3
V1
Vector Product (cross product)
Multiplication of two vectors to produce another vector.
V1 ×V2 = u V1 V2 sinθ
Where u is a unit vector that is perpendicular to both V1 and V2
V 1× V 2
(Vector Notation)
u
V2
V1
⎛V1yV2 z −V1zV2 y
⎜
V1 ×V2 = ⎜V1zV2 x −V1xV2 z
⎜
⎜V V −V V
⎝ 1x 2 y 1 y 2 x
⎞
⎟
⎟
⎟
⎟
⎠
cross product gives a vector in a
V1 ×V2 = (V1yV2 z −V1zV2 y ,V1zV2 x −V1xV2 z ,V1xV2 y −V1yV2 x )
direction perpendicular to the
two original vectors (u) and with
a magnitude equal to the area of
Nice applet demo at:
the shaded parallelogram
http://physics.syr.edu/courses/java-suite/crosspro.html
Matrix Algebra
⎡x y ⎤
⎡a b ⎤
M =⎢
,N = ⎢
⎥
⎥
⎣ z w⎦
⎣c d ⎦
„ Matrix + Matrix (add)
⎡a + x b + y ⎤
M +N =⎢
⎥
+
+
c
z
d
w
⎣
⎦
„ Transpose
⎡a c ⎤
M =⎢
⎥
⎣b d ⎦
T
Watch the
dimensions!!
„ Scale
⎡ sa sb ⎤
sM = ⎢
⎥
⎣ sc sd ⎦
„ Matrix * Matrix
(multiplication)
⎡ax + bz ay + bw⎤
MN = ⎢
⎥
⎣ cx + dz cy + dw⎦
Matrix Inverse
„ M’s inverse, denoted as M-1, is a matrix such
that
⎡1 0 0 0 ⎤
⎢0 1 0 0 ⎥
⎥
MM −1 = M −1M = I = ⎢
⎢
... ⎥
⎢
⎥
⎣0 0 0 1 ⎦
Matrix Algebra
„ Matrix * Vector
⎡a b ⎤
M =⎢
,
⎥
⎣c d ⎦
⎡ax + by ⎤
MV = ⎢
⎥
⎣ cx + dy ⎦
⎡ x⎤
V =⎢ ⎥
⎣ y⎦
Take-home Exercise
⎡a b ⎤
⎡1 2 0 ⎤
⎡3 0 2⎤
⎡ x⎤
A = ⎢⎢0 c ⎥⎥, M = ⎢⎢0 4 8 ⎥⎥, N = ⎢⎢1 2 4⎥⎥, V = ⎢⎢ y ⎥⎥
⎢⎣1 0⎥⎦
⎢⎣4 1 2⎥⎦
⎢⎣0 0 1 ⎥⎦
⎢⎣ 1 ⎥⎦
compute :
MN =
( AM ) N =
( AT M ) N =
AT ( MN ) =
NV =,
VTN =
VV T =
V TV =