Matrices
2023-03-15
Matrices
In Graphics, pervasively used to represent transformations
- Translation, rotation, shear, scale
Matrices is array of numbers (m × n = m rows, n columns). Addition and multiplication by a scalar are trivial: element by element.
Matrix-Matrix Multiplication
- (number of) columns in A must = rows in B
- (M x N) (N x P) = (M x P)
- Element (i, j) in the product is the dot product of row i from A and column j from B
- 比如上面矩阵相乘的结果,第二行第四列是 26,它等于矩阵 A 第二行 和矩阵 B 第四列 的点积,即 26 = 5 × 4 + 2 × 3
- Properties
- Non-Commutative (AB and BA are different in general)
- Associative and distributive
- (AB)C=A(BC)
- A(B+C) = AB + AC
- (A+B)C = AC + BC
Matrix-Vector Multiplication
- Treat vector as a column matrix (m×1)
- Key for transforming points (next lecture)
Transpose of a Matrix
- Switch rows and columns (ij -> ji)
- Property
Identity Matrix and Inverses
单位矩阵可以定义矩阵的逆。如果两个矩阵(不论顺序)相乘的结果是单位矩阵,那么这两个矩阵是互逆的。
Vector multiplication in Matrix form
- Dot product?
- Cross product?
矩阵形式的向量叉乘跟旋转的推导有关,后续章节再具体说。
* 未经同意不得转载。