# 變換矩陣

${\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}cos2\theta &sin2\theta \\sin2\theta &-cos2\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. ISBN 9780387708737.