网站建设seo基本要求,搜索引擎优化seo专员,陕西省水利厅网站建设与管理处,寿光营销型网站建设二维情况下的转换
1 缩放变换
形象理解就是图像在x方向和y方向上放大或者缩小。 代数形式#xff1a; { x ′ k x x y ′ k y y \begin{cases} x k_x x \\ y k_y y \end{cases} {x′kxxy′kyy 矩阵形式#xff1a; ( x ′ y ′ ) ( k x 0 0 k y ) ( x y ) \be…二维情况下的转换
1 缩放变换
形象理解就是图像在x方向和y方向上放大或者缩小。 代数形式 { x ′ k x x y ′ k y y \begin{cases} x k_x x \\ y k_y y \end{cases} {x′kxxy′kyy 矩阵形式 ( x ′ y ′ ) ( k x 0 0 k y ) ( x y ) \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} k_x 0 \\ 0 k_y \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} (x′y′)(kx00ky)(xy) 当 k x k y k_x k_y kxky 时是均匀缩放两个方向同等比例地缩放。
当 k x − 1 , k y 1 k_x -1, k_y 1 kx−1,ky1 是镜像变换类似整个二维平面的图像以y轴为对称轴对称过去一样。
2 切变
平行力作用在物体上的形变 矩阵形式 ( x ′ y ′ ) ( k x a 0 k y ) ( x y ) ( k x x a y k y y ) \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} k_x a \\ 0 k_y \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} k_x x ay \\ k_y y \end{pmatrix} (x′y′)(kx0aky)(xy)(kxxaykyy) x方向上位置坐标整体向右平移。
3 旋转
旋转是指绕着 原点 逆时针旋转 θ \theta θ 的变换。 旋转矩阵如下 R ( c o s θ − s i n θ s i n θ c o s θ ) R \begin{pmatrix} cos \theta -sin\theta \\ sin \theta cos \theta \end{pmatrix} R(cosθsinθ−sinθcosθ) ( x ′ y ′ ) ( c o s θ − s i n θ s i n θ c o s θ ) ( x y ) \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} cos \theta -sin\theta \\ sin \theta cos \theta \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} (x′y′)(cosθsinθ−sinθcosθ)(xy)
旋转矩阵是正交阵转置矩阵等于逆矩阵 R T R − 1 R^T R^{-1} RTR−1
正交矩阵性质
转置等于逆绕某个轴旋转 θ \theta θ 的旋转矩阵的逆就是绕同一轴旋转 − θ -\theta −θ保持向量长度作用于任何向量时向量长度不变列向量行向量正交且单位化
4 线性变换
线性变换的理解参考 https://segmentfault.com/a/1190000041138293 线性映射是由向量空间 V → W V\rightarrow W V→W 的映射而线性变换是线性映射的一个特例是由线性空间 V V V 到其自身的映射。 通俗理解线性变换就是 坐标轴经过 旋转伸缩 等操作原坐标轴上的点一同随着变化然后这些点会在一个新的位置。 ( x ′ y ′ ) ( a b c d ) ( x y ) ( a x b y c y d y ) \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} a b \\ c d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} \begin{pmatrix} ax by \\ cy dy \end{pmatrix} (x′y′)(acbd)(xy)(axbycydy) 其中 ( a , c ) , ( b , d ) (a,c),(b,d) (a,c),(b,d) 是新的坐标系下的基方向上的向量。
线性变换的特点
变换前是直线变换后依然是直线原点保持固定不动
举个例子 原坐标轴x轴和y轴两个基为 i ( 1 , 0 ) , j ( 0 , 1 ) i(1,0), j(0,1) i(1,0),j(0,1) 这个轴上的某个向量为 A → ( 3 , 2 ) T 3 i 2 j \overrightarrow A (3,2)^T 3i2j A (3,2)T3i2j 现在坐标轴有一个线性变换新的基为 i ′ ( 1 , − 2 ) , j ′ ( 3 , 0 ) i(1,-2), j(3,0) i′(1,−2),j′(3,0) 此时得到的新的向量但是它相对于基的关系还是不变的即 A → ′ 3 i ′ 2 j ′ \overrightarrow A 3i 2j A ′3i′2j′
新的 A → ′ \overrightarrow A A ′ 在原坐标系基下的坐标可以通过矩阵乘法求得 A → ′ ( 1 3 − 2 0 ) ( 3 2 ) \overrightarrow A \begin{pmatrix} 1 3 \\ -2 0 \end{pmatrix} \begin{pmatrix} 3 \\ 2 \end{pmatrix} A ′(1−230)(32) 也就是说这个线性变换矩阵是由新的基向量说基可能不准确因为基要求模长为1组成的列向量。
二维线性变换不涉及到平移变换即二维下的仿射变换不是线性变换。
5 齐次坐标变换
平移变换无法用单独的矩阵相乘的形式表示因此引入齐次坐标增加一维。
二维坐标一般被表示为 ( x , y , w ) (x,y,w) (x,y,w) w是一个非零的缩放因子一般情况下取w1
平移矩阵平移(tx, ty)的齐次变换矩阵 T ( 1 0 t x 0 1 t y 0 0 1 ) ( x ′ y ′ 1 ) ( 1 0 t x 0 1 t y 0 0 1 ) ( x y 1 ) T \begin{pmatrix} 1 0 tx \\ 0 1 ty \\ 0 0 1 \end{pmatrix} \\ \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} \begin{pmatrix} 1 0 tx \\ 0 1 ty \\ 0 0 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} T 100010txty1 x′y′1 100010txty1 xy1
6 仿射变换
一个向量空间进行一次线性变换并接上一个平移变换到另一个向量空间。 ( x ′ y ′ 1 ) ( a b t x c d t y 0 0 1 ) ( x y 1 ) \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} \begin{pmatrix} a b t_x \\ c d t_y \\ 0 0 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} x′y′1 ac0bd0txty1 xy1
7 组合变换
可以通过矩阵相乘将多种变换组合在一起只需将齐次坐标与最终的变换矩阵相乘即可。注意矩阵是从右向左计算的矩阵是左乘。
可以将一个变换分解让矩阵按照某一点进行旋转先将旋转点平移到原点然后再平移回去
三维情况下的转换
1 线性齐次变换
变换矩阵如下 T ( x 1 x 2 x 3 0 y 1 y 2 y 3 0 z 1 z 2 z 3 0 0 0 0 1 ) T \begin{pmatrix} x_{1} x_2 x_{3} 0 \\\ y_{1} y_2 y_{3} 0 \\\ z_{1} z_2 z_{3} 0 \\\ 0 0 0 1 \end{pmatrix} T x1 y1 z1 0x2y2z20x3y3z300001 ( x 1 , y 1 , z 1 ) , ( x 2 , y 2 , z 2 ) , ( x 3 , y 3 , z 3 ) (x_1,y_1,z_1),(x_2,y_2, z_2),(x_3,y_3,z_3) (x1,y1,z1),(x2,y2,z2),(x3,y3,z3) 是新的基向量即要变换到的坐标系。 将点坐标左乘一个线性变换矩阵通俗讲就是将原坐标系下的点通过旋转伸长等操作转到新的坐标系下求在新坐标系下点的坐标这个坐标是相对于原坐标系而言的。
同时还可以附加平移操作新的变换矩阵就是 T ( x 1 x 2 x 3 t x y 1 y 2 y 3 t y z 1 z 2 z 3 t z 0 0 0 1 ) T \begin{pmatrix} x_{1} x_2 x_{3} t_x \\\ y_{1} y_2 y_{3} t_y \\\ z_{1} z_2 z_{3} t_z \\\ 0 0 0 1 \end{pmatrix} T x1 y1 z1 0x2y2z20x3y3z30txtytz1
2 旋转变换 任何一个3D旋转都可以表示成绕x轴y轴z轴旋转的组合 R x y z ( α , β , γ ) R x ( α ) R y ( β ) R z ( γ ) R_{xyz}(\alpha, \beta, \gamma) R_x(\alpha)R_y(\beta)R_z(\gamma) Rxyz(α,β,γ)Rx(α)Ry(β)Rz(γ) α β γ \alpha \beta \gamma αβγ 分别代表物体绕x、y、z旋转的角度它们也被称为欧拉角 文章转载自: http://www.morning.sfmqm.cn.gov.cn.sfmqm.cn http://www.morning.dkcpt.cn.gov.cn.dkcpt.cn http://www.morning.nbsfb.cn.gov.cn.nbsfb.cn http://www.morning.nxhjg.cn.gov.cn.nxhjg.cn http://www.morning.bfhfb.cn.gov.cn.bfhfb.cn http://www.morning.yllym.cn.gov.cn.yllym.cn http://www.morning.xsbhg.cn.gov.cn.xsbhg.cn http://www.morning.tsflw.cn.gov.cn.tsflw.cn http://www.morning.rcntx.cn.gov.cn.rcntx.cn http://www.morning.xclgf.cn.gov.cn.xclgf.cn http://www.morning.rgrdd.cn.gov.cn.rgrdd.cn http://www.morning.mxnfh.cn.gov.cn.mxnfh.cn http://www.morning.mfxcg.cn.gov.cn.mfxcg.cn http://www.morning.qnhpq.cn.gov.cn.qnhpq.cn http://www.morning.yggdq.cn.gov.cn.yggdq.cn http://www.morning.ndcjq.cn.gov.cn.ndcjq.cn http://www.morning.mbzlg.cn.gov.cn.mbzlg.cn http://www.morning.kehejia.com.gov.cn.kehejia.com http://www.morning.cpfbg.cn.gov.cn.cpfbg.cn http://www.morning.lcdtb.cn.gov.cn.lcdtb.cn http://www.morning.vvbsxm.cn.gov.cn.vvbsxm.cn http://www.morning.lbbyx.cn.gov.cn.lbbyx.cn http://www.morning.rgxcd.cn.gov.cn.rgxcd.cn http://www.morning.jcxgr.cn.gov.cn.jcxgr.cn http://www.morning.sqyjh.cn.gov.cn.sqyjh.cn http://www.morning.cbczs.cn.gov.cn.cbczs.cn http://www.morning.lbfgq.cn.gov.cn.lbfgq.cn http://www.morning.kjyhh.cn.gov.cn.kjyhh.cn http://www.morning.fslrx.cn.gov.cn.fslrx.cn http://www.morning.mtcnl.cn.gov.cn.mtcnl.cn http://www.morning.rpms.cn.gov.cn.rpms.cn http://www.morning.lqgfm.cn.gov.cn.lqgfm.cn http://www.morning.hbnwr.cn.gov.cn.hbnwr.cn http://www.morning.bpmnj.cn.gov.cn.bpmnj.cn http://www.morning.nrtpb.cn.gov.cn.nrtpb.cn http://www.morning.lysrt.cn.gov.cn.lysrt.cn http://www.morning.hmpxn.cn.gov.cn.hmpxn.cn http://www.morning.gzxnj.cn.gov.cn.gzxnj.cn http://www.morning.yzzfl.cn.gov.cn.yzzfl.cn http://www.morning.ghpld.cn.gov.cn.ghpld.cn http://www.morning.rrqgf.cn.gov.cn.rrqgf.cn http://www.morning.kpxnz.cn.gov.cn.kpxnz.cn http://www.morning.rjqtq.cn.gov.cn.rjqtq.cn http://www.morning.ktsth.cn.gov.cn.ktsth.cn http://www.morning.nkkpp.cn.gov.cn.nkkpp.cn http://www.morning.qtltg.cn.gov.cn.qtltg.cn http://www.morning.wqpr.cn.gov.cn.wqpr.cn http://www.morning.tktcr.cn.gov.cn.tktcr.cn http://www.morning.gwtbn.cn.gov.cn.gwtbn.cn http://www.morning.mqghs.cn.gov.cn.mqghs.cn http://www.morning.yfqhc.cn.gov.cn.yfqhc.cn http://www.morning.juju8.cn.gov.cn.juju8.cn http://www.morning.ctqlq.cn.gov.cn.ctqlq.cn http://www.morning.wcghr.cn.gov.cn.wcghr.cn http://www.morning.swlwf.cn.gov.cn.swlwf.cn http://www.morning.qdrrh.cn.gov.cn.qdrrh.cn http://www.morning.smjyk.cn.gov.cn.smjyk.cn http://www.morning.duqianw.com.gov.cn.duqianw.com http://www.morning.ygkb.cn.gov.cn.ygkb.cn http://www.morning.wtcbl.cn.gov.cn.wtcbl.cn http://www.morning.mkhwx.cn.gov.cn.mkhwx.cn http://www.morning.njqpg.cn.gov.cn.njqpg.cn http://www.morning.hdrsr.cn.gov.cn.hdrsr.cn http://www.morning.trrhj.cn.gov.cn.trrhj.cn http://www.morning.i-bins.com.gov.cn.i-bins.com http://www.morning.ztrht.cn.gov.cn.ztrht.cn http://www.morning.gpmrj.cn.gov.cn.gpmrj.cn http://www.morning.pccqr.cn.gov.cn.pccqr.cn http://www.morning.grxbw.cn.gov.cn.grxbw.cn http://www.morning.znmwb.cn.gov.cn.znmwb.cn http://www.morning.dhmll.cn.gov.cn.dhmll.cn http://www.morning.rdtp.cn.gov.cn.rdtp.cn http://www.morning.cwjsz.cn.gov.cn.cwjsz.cn http://www.morning.jfbgn.cn.gov.cn.jfbgn.cn http://www.morning.gmmyn.cn.gov.cn.gmmyn.cn http://www.morning.wflsk.cn.gov.cn.wflsk.cn http://www.morning.gmyhq.cn.gov.cn.gmyhq.cn http://www.morning.pzrrq.cn.gov.cn.pzrrq.cn http://www.morning.lnnc.cn.gov.cn.lnnc.cn http://www.morning.krrjb.cn.gov.cn.krrjb.cn