# 变换矩阵

${\displaystyle T({\vec {x}})=\mathbf {A} {\vec {x}}}$

## 寻找变换矩阵

${\displaystyle \mathbf {A} ={\begin{pmatrix}T({\vec {e}}_{1})&T({\vec {e}}_{2})&\cdots &T({\vec {e}}_{n})\end{pmatrix}}}$

${\displaystyle T({\vec {x}})=5{\vec {x}}={\begin{pmatrix}5&&0\\0&&5\end{pmatrix}}{\vec {x}}}$

## 在二维图形中的应用示例

### 旋转

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

### 缩放

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}s_{x}&0\\0&s_{y}\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

### 推移

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}1&k\\0&1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}1&0\\k&1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

### 反射

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}2u_{x}^{2}-1&2u_{x}u_{y}\\2u_{x}u_{y}&2u_{y}^{2}-1\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}\cos 2\theta &\sin 2\theta \\\sin 2\theta &-\cos 2\theta \end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

### 正投影

${\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}={\begin{pmatrix}u_{x}^{2}&u_{x}u_{y}\\u_{x}u_{y}&u_{y}^{2}\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}}$

## 组合变换与逆变换

${\displaystyle \mathbf {B} (\mathbf {A} {\vec {x}})=(\mathbf {BA} ){\vec {x}}}$

## 其它类型的变换

### 仿射变换

${\displaystyle {\begin{pmatrix}x'\\y'\\1\end{pmatrix}}={\begin{pmatrix}1&0&t_{x}\\0&1&t_{y}\\0&0&1\end{pmatrix}}{\begin{pmatrix}x\\y\\1\end{pmatrix}}}$

${\displaystyle {\begin{pmatrix}\cos \theta &-\sin \theta &0\\\sin \theta &\cos \theta &0\\0&0&1\end{pmatrix}}}$

### 透视投影

${\displaystyle {\begin{pmatrix}x_{c}\\y_{c}\\z_{c}\\w_{c}\end{pmatrix}}={\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&1&0\end{pmatrix}}{\begin{pmatrix}x\\y\\z\\1\end{pmatrix}}}$

(这个乘法的计算结果是${\displaystyle (x_{c},y_{c},z_{c},w_{c})}$ = ${\displaystyle (x,y,z,z)}$。）

${\displaystyle {\begin{pmatrix}x'\\y'\\z'\end{pmatrix}}={\begin{pmatrix}x_{c}/w_{c}\\y_{c}/w_{c}\\z_{c}/w_{c}\end{pmatrix}}}$

## 参考资料

1. ^ Gentle, James E. Matrix Transformations and Factorizations. Matrix Algebra: Theory, Computations, and Applications in Statistics. Springer. 2007 [2014-10-18]. ISBN 9780387708737. （原始内容存档于2017-02-21） （英语）.