查看“︁仿射变换”︁的源代码
←
仿射变换
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{NoteTA|G1=Math}} [[File:Fractal fern explained.png|thumb|200px|一個使用仿射变换所製造有[[自相似]]性的[[碎形]]]] '''仿射变换'''(Affine transformation),又称'''仿射映射''',是指在[[几何]]中,對一个[[向量空间]]进行一次[[线性变换]]并接上一个[[平移]],变换为另一个向量空间。 一個對向量<math> \vec{x} </math>平移<math> \vec{b} </math>,與旋轉缩放<math> A</math>的仿射映射為 :<math> \vec{y} = A \vec{x} + \vec{b} </math> 上式在[[齐次坐标]]上,等價於下面的式子 :<math> \begin{bmatrix} \vec{y} \\ 1 \end{bmatrix} = \begin{bmatrix} A & \vec{b} \ \\ 0, \ldots, 0 & 1 \end{bmatrix} \begin{bmatrix} \vec{x} \\ 1 \end{bmatrix} </math> 在[[分形]]的研究裡,收縮平移仿射映射可以製作具有[[自相似|自相似性]]的[[分形]]。 ==數學定義== 一个于两[[仿射空间]]间定义的仿射变换 <math>f\colon \mathcal{A}\to\mathcal{B}</math> 是一个点集映射,线性地作用于向量(即空间中的点之间的向量)。形式化表述是,''<math>f</math> ''决定一线性变换 <math>\varphi</math>,使得对于任意 <math>\mathcal A</math> 中的点对 <math>P,Q</math>,有: :<math>\overrightarrow{f(P)~f(Q)}=\varphi\left(\overrightarrow{PQ}\right)</math> 或记 :<math>f(Q)-f(P)=\varphi(Q-P).</math> 我们可以以其他一些方式解释这一定义,以下进行说明: 若于 <math>\mathcal A</math> 中选定一[[原點]] <math>O</math>,记其于 <math>\mathcal B</math> 中的像为 <math>f(O)</math>,那么就意味着,对于任意向量 <math>\boldsymbol{x}\in\mathcal A</math> ,有 :<math>f\colon(O+\boldsymbol{x})\mapsto(B+\varphi(\boldsymbol x)).</math> 而若于 <math>\mathcal B</math> 中选定一原点 <math>O'</math>,则其可分解为一将 <math>O</math> 映到 <math>O'</math> 的仿射变换 <math>g\colon\mathcal A\to\mathcal B</math>,换言之,遵从向量 <math>\boldsymbol b=\overrightarrow{O'B}</math> 之变换, <math>g\colon(O+\boldsymbol{x})\mapsto(O'+\varphi(\boldsymbol x)).</math> 以上可以直观地总结为,仿射变换包含一个线性映射与一个[[变换矩阵|变换]]。 === 等价定义 === 给定相同域上的两仿射空间 <math>\mathcal{A}</math> 和 <math>\mathcal{B}</math>,称一映射 <math>f: \mathcal{A} \to \mathcal{B}</math> 为仿射变换,[[当且仅当]]对于任意 <math>\mathcal{A}</math> 上满足 <math>\sum_{i\in I}\lambda_i=\boldsymbol 1</math> 的权重点簇 <math>\{(a_i, \lambda_i)\}_{i\in I}</math> 有<ref>{{Cite journal |last=Schneider |first=Philip K. |last2=Eberly |first2=David H. |title=Geometric Tools for Computer Graphics |url=https://books.google.com/books?id=3Q7HGBx1uLIC&pg=PA98 |journal=Morgan Kaufmann |year=2003 |page=98 |isbn=978-1-55860-594-7 |access-date=2024-06-18 |archive-date=2023-10-25 |archive-url=https://web.archive.org/web/20231025010127/https://books.google.com/books?id=3Q7HGBx1uLIC&pg=PA98#v=onepage&q&f=false |dead-url=no }}</ref> <math>f\left(\sum_{i\in I}\lambda_ia_i\right)=\sum_{i\in I}\lambda_if\left(a_i\right).</math> 换言之,<math>f</math> 保持了原相的[[质心]]。 ==表示== 如上所示,仿射變換為兩函數的[[複合函數|複合]]:[[平移]]及[[線性映射]]。普通向量代數用[[矩陣乘法]]呈現線性映射, 用[[矢量|向量加法]]表示平移。正式言之,於有限維度之例中,假如該線性映射被表示為一矩陣「A」,平移被表示為向量 <math>\vec{b}</math>,一仿射映射 <math>f</math>可被表示為 :<math> \vec{y} = f(\vec{x}) = A \vec{x} + \vec{b}. </math> ===增廣矩陣=== [[File:Affine transformations.ogv|thumb|250px|right|二維平面上的仿射變換可呈現於三維空間中。平移即為沿著z軸的[[錯切]],旋轉則以z軸為軸心]] 使用一[[增廣矩陣]]與一增廣向量,用一[[矩陣乘法]]同時表示平移與線性映射是有可能的。此技術需要所有向量在其末端擴長“1”且所有矩陣都於底部添加一排零,右邊擴長一列轉換向量,及右下角添加一個“1”。 :<math> \begin{bmatrix} \vec{y} \\ 1 \end{bmatrix} = \left[ \begin{array}{ccc|c} \, & A & & \vec{b} \ \\ 0 & \ldots & 0 & 1 \end{array} \right] \begin{bmatrix} \vec{x} \\ 1 \end{bmatrix} </math> 等價於 :<math> \vec{y} = A \vec{x} + \vec{b}. </math> 以上所言之擴長矩陣被稱為“仿射變換矩陣”,又或稱為“投射變換矩陣”(其可應用於[[投影轉換]])。 此表示法以''K''<sup>''n''</sup>之[[半直積]]與GL(''n'', ''k'')展示了 所有[[反函數|可逆]]仿射變換的集合。此為一個於眾函數集結下進行的一個[[群]],被稱為[[仿射群]]。 普通矩陣向量乘法總將原點映射至原點,因此無法呈現平移(原點必須映射至其他點)。藉由於所有向量上擴增一座標“1”,我們將原空間映至更高維空間的一個子集合以進行變換。在該空間中,原本之空間佔有了擴長座標一的1的子集合。因此原空間的原點可在(0,0, ... 0, 1)。原空間的平移可藉由更高維度空間的線性轉換來達成(即為[[錯切|錯切變換]])。在高維度中的座標即為[[齊次座標]]的一例。假如原空間為[[歐幾里德空間|歐幾里德]],則更高維空間為[[實射影空間]]。 使用齊次座標的優點為,藉由相對應矩陣之乘積,可將任意數目的仿射變換[[複合函數|結合]]為一。此性質被大量運用於[[計算機圖形]],[[計算機視覺]]與[[機器人學]]。 ==性質== 仿射變換保留了: # 點之間的{{link-en|共线性|Collinearity}}:在同一条直线上的三个或更多的点(称为共线点)在变换后依然在同一条直线上(共线); # 直线的[[平行|平行性]]:两条或以上的平行直线,在变换后依然平行; # 集合的[[凸性]]:凸集合变换后依然是凸集合。并且,最初的[[极值|极值点]]被映射到变换后的极值点集<ref name=res>{{cite web|last1=Reinhard Schultz|title=Affine transformations and convexity|url=http://math.ucr.edu/~res/math145A-2014/affine+convex.pdf|accessdate=27 February 2017|archive-date=2020-11-25|archive-url=https://web.archive.org/web/20201125201437/https://math.ucr.edu/~res/math145A-2014/affine+convex.pdf|dead-url=no}}</ref>; # 平行线段的长度的比例:两条由点 <math>p_1,p_2,p_3,p_4</math> 定义的'''平行'''线段,<math>\overrightarrow{p_1p_2}</math> 與 <math>\overrightarrow{p_3p_4}</math>的长度的比例等于<math>\overrightarrow{f(p_1)f(p_2)}</math>与<math>\overrightarrow{f(p_3)f(p_4)}</math>的长度的比例; # 不同質量的點组成集合的[[质心]]。 仿射變換為[[可逆|可逆的]][[当且仅当]]<math>A</math>為可逆的。用矩陣表示,其逆元為: <math> \left[ \begin{array}{ccc|c} & A^{-1} & & -A^{-1}\vec{b} \ \\ 0, & \ldots & ,0 & 1 \end{array} \right] </math> 可逆仿射變換組成{{link-en|仿射群|Affine_group}},其中包含具n階的[[一般線性群]]為子群,且自身亦為一 <math>n+1</math> 階的一般線性群之子群。 當A為常數乘以[[正交矩陣]]時,此子集合構成一子群,稱之為[[相似_(幾何)|相似變換]]。舉例而言,假如仿射變換於一平面上且假如 <math>A</math> 之[[行列式]]為 <math>1</math> 或 <math>-1</math> ,那麼該變換即為{{link-en|等面積變換|Equiareal_map}}。此類變換組成被稱為''等仿射群''的子群。一同時為等面積變換與相似變換的變換,即為一平面上保持[[歐幾里德距離]]不變的[[等距同构|保距映射]]。 這些群都有一保留了原[[定向_(向量空間)|定向]]的子群,也就是其對應之 <math>A</math> 的行列式大於零。最後一个例子,即三維空间中[[剛體]]的運動组成的群(旋轉和平移),刚体的运动在机器人学中尤为常用<ref>{{cite web |author1=Robotic Systems Lab, ETH Zurich |title=Robot Dynamics Lecture Notes |url=https://ethz.ch/content/dam/ethz/special-interest/mavt/robotics-n-intelligent-systems/rsl-dam/documents/RobotDynamics2017/RD_HS2017script.pdf |accessdate=2020-04-25 |archive-date=2020-11-12 |archive-url=https://web.archive.org/web/20201112021439/https://ethz.ch/content/dam/ethz/special-interest/mavt/robotics-n-intelligent-systems/rsl-dam/documents/RobotDynamics2017/RD_HS2017script.pdf |dead-url=no }}</ref>。 如果有一固定點,我們可以將其當成原點,則仿射變換被縮還到一線性變換。這使得變換更易於分類與理解。舉例而言,將一變換敘述為特定軸的旋轉,相較於將其形容為平移與旋轉的結合,更能提供變換行為清楚的解釋。只是,這取決於應用與內容。 ==實例== ===實數之仿射變換=== 函數{{nowrap|1=''f'' : '''R''' → '''R'''}}, {{nowrap|1=''f''(''x'') = ''mx'' + ''c''}} ,其中''m''與''c''為常數,此即為一般之仿射變換。 ===有限體的仿射變換=== 以下等式表示了[[有限體]](2<sup>8</sup>)中的仿射變換: :<math> \{\,a'\,\} = M\{\,a\,\} \oplus \{\,v\,\}, </math> 此處[M]為矩陣 且 {v} 為向量 : {| |- |:<math>M\{\,a\,\}= \begin{bmatrix} 1&0&0&0&1&1&1&1 \\ 1&1&0&0&0&1&1&1 \\ 1&1&1&0&0&0&1&1 \\ 1&1&1&1&0&0&0&1 \\ 1&1&1&1&1&0&0&0 \\ 0&1&1&1&1&1&0&0 \\ 0&0&1&1&1&1&1&0 \\ 0&0&0&1&1&1&1&1 \end{bmatrix} </math> :<math>\{\,v\,\}= \begin{bmatrix} 1 \\ 1 \\ 0 \\ 0 \\ 0 \\ 1 \\ 1 \\ 0 \end{bmatrix}.</math> |} 舉例來講,將以[[字節序|大端序]]二進位表示的元素{a} = ''y''<sup>7</sup> + ''y''<sup>6</sup> + ''y''<sup>3</sup> + ''y'' = {11001010}轉換成[[字節序|大端序]]十六進位,計算如下: :<math>a_0' = a_0 \oplus a_4 \oplus a_5 \oplus a_6 \oplus a_7 \oplus 1 = 0 \oplus 0 \oplus 0 \oplus 1 \oplus 1 \oplus 1 = 1</math> :<math>a_1' = a_0 \oplus a_1 \oplus a_5 \oplus a_6 \oplus a_7 \oplus 1 = 0 \oplus 1 \oplus 0 \oplus 1 \oplus 1 \oplus 1 = 0</math> :<math>a_2' = a_0 \oplus a_1 \oplus a_2 \oplus a_6 \oplus a_7 \oplus 0 = 0 \oplus 1 \oplus 0 \oplus 1 \oplus 1 \oplus 0 = 1</math> :<math>a_3' = a_0 \oplus a_1 \oplus a_2 \oplus a_3 \oplus a_7 \oplus 0 = 0 \oplus 1 \oplus 0 \oplus 1 \oplus 1 \oplus 0 = 1</math> :<math>a_4' = a_0 \oplus a_1 \oplus a_2 \oplus a_3 \oplus a_4 \oplus 0 = 0 \oplus 1 \oplus 0 \oplus 1 \oplus 0 \oplus 0 = 0</math> :<math>a_5' = a_1 \oplus a_2 \oplus a_3 \oplus a_4 \oplus a_5 \oplus 1 = 1 \oplus 0 \oplus 1 \oplus 0 \oplus 0 \oplus 1 = 1</math> :<math>a_6' = a_2 \oplus a_3 \oplus a_4 \oplus a_5 \oplus a_6 \oplus 1 = 0 \oplus 1 \oplus 0 \oplus 0 \oplus 1 \oplus 1 = 1</math> :<math>a_7' = a_3 \oplus a_4 \oplus a_5 \oplus a_6 \oplus a_7 \oplus 0 = 1 \oplus 0 \oplus 0 \oplus 1 \oplus 1 \oplus 0 = 1.</math> 于是, {a′} = y7 + y6 + y5 + y3 + y2 + 1 = {11101101} = {ED}。 ===平面幾何之仿射變換=== [[File:Geometric affine transformation example.png|thumb|250px|一個實數平面上的簡單仿射變換]] 在 ℝ<sup>2</sup>,左方所示之變換即為以下映射: :<math>\begin{bmatrix} x \\ y\end{bmatrix} \mapsto \begin{bmatrix} 0&1\\ 2&1 \end{bmatrix}\begin{bmatrix} x \\ y\end{bmatrix} + \begin{bmatrix} -100 \\ -100\end{bmatrix}</math> 將原紅色三角形之三個[[頂點 (幾何)|頂點]]作變換後給出了新藍色三角形的三個頂點。事實上,所有三角形皆可由仿射變換來達成,所有平行四邊形也可以,但一般四邊形不行。 == 参看 == * [[变换矩阵#仿射变换|仿射变换的变换矩阵]] * [[平移#矩阵表示|平移的矩阵表示]] * [[仿射群]] * [[仿射几何]] * [[线性]](第二个意思是在1维中的仿射变换) * [[三维投影]] {{分形}} [[Category:仿射几何|*]] [[Category:線性代數|F]]
该页面使用的模板:
Template:Cite journal
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Link-en
(
查看源代码
)
Template:NoteTA
(
查看源代码
)
Template:Nowrap
(
查看源代码
)
Template:分形
(
查看源代码
)
返回
仿射变换
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息