线性变换与变换复合Linear Transformations & Composition
同样的两次变换,交换顺序后为什么会得到不同结果?Why can the same two transformations give different results in a different order?
前置知识:Prerequisites: B05:矩阵与批量计算。B05: matrices and batch computation.
复习前置:Review prerequisites: B05 · 矩阵与批量计算Matrices & Batch Computation
学完后你能:After this lesson you can: 根据矩阵列理解变换,并用反例比较不同操作顺序。Interpret transformations from matrix columns and compare their order with a counterexample.
动手观察Explore
单步比较“先旋转、后横向缩放”与相反顺序。先预测同一个点最后在哪里。Step through “rotate then horizontally scale” and the reverse order. First predict where the same point ends up.
从观察到解释From observation to explanation
矩阵作用于坐标A matrix acts on coordinates
矩阵的第一列告诉我们 (1, 0) 被送到哪里,第二列告诉我们 (0, 1) 被送到哪里。网格上的每个点都按同一规则变换,原点保持不动。The first matrix column tells us where (1, 0) goes, and the second where (0, 1) goes. Every point on the grid follows the same rule and the origin stays fixed.
比较次序Compare the order
把 v = (1, 1) 逆时针旋转 90° 得 (−1, 1),再把横坐标乘 2,得到 (−2, 1)。反过来先横向缩放得 (2, 1),再旋转得 (−1, 2)。终点不同。Rotate v = (1, 1) 90° counterclockwise to get (−1, 1), then double its horizontal coordinate to get (−2, 1). In reverse order, scaling gives (2, 1), then rotating gives (−1, 2). The endpoints differ.
为什么称为线性Why “linear”?
线性变换保留向量加法与数乘:T(au+bv) = aT(u)+bT(v),其中 T 是变换、u 和 v 是向量、a 和 b 是实数。平移会移动原点,因此一般不是线性变换。A linear transformation preserves vector addition and scaling: T(au+bv) = aT(u)+bT(v), where T is the transformation, u and v are vectors, and a and b are real numbers. Translation moves the origin and is generally not linear.
公式与符号Formula and symbols
v 是输入列向量,A、B 是变换矩阵,v′ 是输出;BA 表示先做右边的 A,再做左边的 B。v is an input column vector, A and B are transformation matrices, and v′ is the output. BA applies A on the right first, then B on the left.
留意这个区别Watch for this
矩阵连乘时右边先作用。某些特殊变换可以交换顺序;一个不相等的反例只说明一般不能随意交换。In a matrix product the rightmost transformation acts first. Some special transformations commute; a single counterexample shows only that swapping is not valid in general.
继续探索Explore further
课后练习
检验你的理解