变换矩阵

变换矩阵(英語:transformation matrix)是数学线性代数中的一个概念。线性变换采用矩阵表示时,如果T是一个把Rn映射到Rm的线性变换,且x是一个具有n个元素的column vector,那么

我们把m×n的矩阵A,称为T的变换矩阵

应用

任意线性变换都可以用矩阵表示为易于计算的一致形式[1],并且多个变换也可以很容易地通过矩阵的相乘连接在一起。

线性变换不是唯一可以用矩阵表示的变换。Rn维的仿射变换透视投影都可以用齐次坐标表示为RPn+1维(即n+1维的真实投影空间)的线性变换。因此,在三维计算机图形学中大量使用着4x4的矩阵变换。

寻找变换矩阵

如果已经有一个函数型的线性变换,那么通过T标准基每个向量进行简单变换,然后将结果插入矩阵的列中,这样很容易就可以确定变换矩阵A,即

例如,函数是线性变换,通过上面的过程得到(假设n = 2)

在二维图形中的应用示例

最为常用的几何变换都是线性变换,这包括旋转、缩放、切变、反射以及正投影。在二维空间中,线性变换可以用2×2的变换矩阵表示。

旋转

绕原点逆时针旋转 θ 度角的变换公式是 ,用矩阵表示为:

缩放

缩放(反矩陣)公式为 ,用矩阵表示为:

平移

平移有两种可能的形式:

平行于 x 轴的推移为 ,矩阵表示为:

平行于 y 轴的推移为 ,矩阵表示为:

反射

为了沿经过原点的直线反射向量,假设(ux, uy)为直线方向的单位向量。变换矩阵为:

不经过原点的直线的反射是仿射变换,而不是线性变换。

若一座標(x, y)沿直線 進行反射,則其影像(x', y')可用以下公式求得:

正投影

为了将向量正投影到一条经过原点的直线,假设(ux, uy)是直线方向的单位向量,变换矩阵为:

跟反射一样,正投影到一条不经过原点的直线的变换是仿射变换,而不是线性变换。

平行投影也是线性变换,也可以用矩阵表示。但是透视投影不是线性变换,必须用齐次坐标表示。

组合变换与逆变换

用矩阵表示线性变换的一个主要动力就是可以很容易地进行组合变换以及逆变换。

组合可以通过矩阵乘法来完成。如果AB是两个线性变换,那么对向量x先进行A变换,然后进行B变换的过程为:

换句话说,AB变换的组合等同于两个矩阵乘积的变换。需要注意的是先AB表示为BA而不是AB

能够通过两个矩阵相乘将两个变换组合在一起这样的能力就使得可以通过逆矩阵进行变换的逆变换。A -1表示A的逆变换。

变换矩阵并不都是可逆的,但通常都可以进行直观的解释。在上一节中,几乎所有的变换都是可逆的。只要都不为零,那么缩放变换也是可逆的。另外,正投影永远是不可逆的。

其它类型的变换

仿射变换

为了表示仿射变换,需要使用齐次坐标,即用三维向量(x, y, 1)表示二维向量,对于高维来说也是如此。按照这种方法,就可以用矩阵乘法表示变换。; 变为

在矩阵中增加一列与一行,除右下角的元素为1外其它部分填充为0,通过这种方法,所有的线性变换都可以转换为仿射变换。例如,上面的旋转矩阵变为

通过这种方法,使用与前面一样的矩阵乘积可以将各种变换无缝地集成到一起。

当使用仿射变换时,齐次坐标向量w从来不变,这样可以把它当作为1。但是,透视投影中并不是这样。

透视投影

三维计算机图形学中另外一种重要的变换是透视投影。与平行投影沿着平行线将物体投影到图像平面上不同,透视投影按照从投影中心这一点发出的直线将物体投影到图像平面。这就意味着距离投影中心越远投影越小,距离越近投影越大。

最简单的透视投影将投影中心作为坐标原点,z = 1作为图像平面,这样投影变换为; ,用齐次坐标表示为:

(这个乘法的计算结果是 = 。)

在进行乘法计算之后,通常齐次元素wc并不为1,所以为了映射回真实平面需要进行齐次除法,即每个元素都除以wc

更加复杂的透视投影可以是与旋转、缩放、平移、切变等组合在一起对图像进行变换。

参见

参考资料

  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) (英语). 

外部連結

Read other articles:

JGTRRA Jobs and Growth Tax Relief Reconciliation Act of 2003Long titleAn act to provide for reconciliation pursuant to section 201 of the concurrent resolution on the budget for fiscal year 2004.Acronyms (colloquial)JGTRRAEnacted bythe 108th United States CongressCitationsPublic lawPub. L.Tooltip Public Law (United States) 108–27 (text) (PDF)Statutes at Large117 Stat. 752Legislative historyIntroduced in the House as H.R. 2 by Bill Thomas (R-CA) on February 27, 2003C...

 

Dieser Artikel behandelt das Ereignis – zu anderen Bedeutungen siehe Hochzeit (Begriffsklärung). Hochzeitspaar im Standesamt (Märchenvilla Eberswalde, 2005) Vornehme Hochzeitsgesellschaft (Gemälde von Wolfgang Heimbach, 1637) Die Eheschließung – auch Hochzeit, Heirat, Vermählung und Trauung – umfasst in Abhängigkeit von den jeweiligen religiösen, rechtlichen und kulturellen Rahmenbedingungen einer Gesellschaft vielfältige soziale und privatrechtliche Verträge, religiöse und we...

 

Альваро МелІм'я при народженні ісп. Álvaro García SierraПсевдо Álvaro MelНародився 14 вересня 1996(1996-09-14)[1] (27 років)Саламанка, Кастилія і Леон, ІспаніяКраїна  ІспаніяДіяльність актор, модель, інфлюєнсерЗнання мов іспанська і англійськаIMDb ID 9603584 Альваро Гарсіа Сьєрра (...

Ця стаття є частиною Проєкту:Населені пункти України (рівень: невідомий) Портал «Україна»Мета проєкту — покращувати усі статті, присвячені населеним пунктам та адміністративно-територіальним одиницям України. Ви можете покращити цю статтю, відредагувавши її, а на стор...

 

Biological taxa superclass Opalinata Opalina ranarum, a species of Opalinea Scientific classification Domain: Eukaryota Clade: Diaphoretickes Clade: SAR Clade: Stramenopiles Phylum: Bigyra Infraphylum: Placidozoa Superclass: OpalinataWenyon, 1926 em. Cavalier-Smith, 1996 stat. n. 2006[1] Classes[1] Opalinea Blastocystea Wikispecies has information related to Opalinata. Opalinata is a superclass of non-phagotrophic heterokonts that unites the classes Opalinea and Blastocystea, ...

 

Confederate infantry assault during the Battle of Gettysburg in the American Civil War The article's lead section may need to be rewritten. Please help improve the lead and read the lead layout guide. (January 2023) (Learn how and when to remove this template message) For the book of that title, see George R. Stewart. Pickett's ChargePart of the Battle of GettysburgGeneral Pickett's Famous Charge at Gettysburg drawn by Alfred WaudDateJuly 3, 1863 (1863-07-03)LocationGettysburg,...

2021 Serbian film Dara of JasenovacOfficial movie posterDirected byPredrag AntonijevićWritten byNataša DrakulićProduced byPredrag AntonijevićMaksa ĆatovićPetar VukašinovićStarringBiljana ČekićVuk KostićMarko JanketićCinematographyMiloš KodemoEdited byFilip DedićMusic byRoman GoršekAleksandra KovačProductioncompaniesDandelion Production IncFilm DanasKomunaCineplanetDistributed byMegaCom Film[1]101 Studios (US)[2]Release dates 5 February 2021 (2021...

 

Overview of the languages spoken in the United States Languages of the United StatesOfficialNone[a]NationalEnglish (de facto)MainEnglish 78.0%, Spanish 13.3%, other Indo-European languages 3.8%, Asian and Pacific languages 3.6%, other languages 1.2% (2022 survey by the Census Bureau[2])IndigenousNavajo, Cherokee, Choctaw, Muscogee, Dakota, Lakota, Western Apache, Keres, Hopi, Zuni, Kiowa, Ojibwe, O'odham, Miwuk[3][4] Others Abenaki, Achumawi, Acolapissa, Adai, ...

 

Soviet politician In this name that follows Eastern Slavic naming conventions, the patronymic is Yakovlevich and the family name is Sokolnikov. Grigori SokolnikovГригорий СокольниковGrigori Sokolnikov (1888–1939)People's Commissar for Finance of the USSRIn office6 July 1923 – 16 January 1926PremierVladimir Lenin (until 1924)Alexei RykovPreceded byNone—post createdSucceeded byNikolai BryukhanovPeople's Commissar for Finance of the RSFSRIn office22 November...

1988 video game This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help to improve this article by introducing more precise citations. (May 2009) (Learn how and when to remove this template message) 1988 video gameBonze AdventureDeveloper(s)TaitoPublisher(s)TaitoPlatform(s)Arcade, PC EngineReleaseJP: 1988(Arcade)JP: 1990(PC Engine)Genre(s)PlatformMode(s)Single-player, multiplayer Bonze Advent...

 

Pour les articles homonymes, voir Jeux olympiques de Tokyo. Jeux olympiques d'été de 2020 Localisation Pays hôte Japon Ville hôte Tokyo Coordonnées 35° 40′ 15″ N, 139° 46′ 19″ E Date Du 23 juillet au 8 août 2021 Ouverture officielle par NaruhitoEmpereur du Japon Participants Pays 204 (+2 délégation CIO) Athlètes 11 092 (attendus)[1]( masc. et fém.) Compétition Nouveaux sports Escalade sportive, karaté, skateboard, surf, basket-ball à t...

 

Willy Brandt (1980) Willy Brandt, Richard Nixon Willy Brandt (18 Desember 1913 – 8 Oktober 1992) adalah politikus dan kanselir Republik Federasi Jerman dari tahun 1969 sampai 1974. Ia dilahirkan sebagai Herbert Ernst Karl Frahm di Lübeck, Jerman. Kabinet Brandt Pertama 21 Oktober 1969 - 14 Desember 1972 Willy Brandt (SPD) - Kanselir Walter Scheel (FDP) - Wakil Kanselir dan Menteri Luar Negeri Helmut Schmidt (SPD) - Menteri Pertahanan Hans-Dietrich Genscher (FDP) - Menteri Per...

Leader of a collaborative work equivalent to the author of a book For the band, see The Auteurs. An auteur (/oʊˈtɜːr/; French: [otœʁ], lit. 'author') is an artist with a distinctive approach, usually a film director whose filmmaking control is so unbounded and personal that the director is likened to the author of the film,[1] thus manifesting the director's unique style or thematic focus.[2] As an unnamed value, auteurism originated in French film criticism of t...

 

Railway Station in Maharashtra, India This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Sondad railway station – news · newspapers · books · scholar ...

 

Kereta Rel Disel Elektrik Bandara KualanamuKereta rel diesel elektrik adalah kereta listrik yang menggunakan generator listrik dengan bantuan mesin diesel. Generator listrik digunakan sebagai penghasil energi listrik. Penempatan mesin diesel dapat di bagian atas maupun bagian bawah dari kereta. Kereta rel diesel elektrik desain lama terkadang hanya menggunakan motor traksi dan tidak menggunakan mesin diesel dan generator listrik. Sedangkan kereta rel diesel elektrik modern memiliki mesin dies...

Japanese association football player (born 1986) The native form of this personal name is Okazaki Shinji. This article uses Western name order when mentioning individuals. Shinji Okazaki Okazaki with Japan at the 2018 FIFA World CupPersonal informationFull name Shinji Okazaki[1]Date of birth (1986-04-16) 16 April 1986 (age 37)[2]Place of birth Takarazuka, Hyōgo, JapanHeight 1.74 m (5 ft 9 in)[3]Position(s) ForwardTeam informationCurrent team Si...

 

American singer-songwriter This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Carson Robison – news · newspapers · books · scholar · JSTOR (March 2017) (Learn how and when to remove this template message) Carson Jay RobisonBackground informationBirth nameCarson Jay RobisonAlso known asCharles RobisonBorn(1890-0...

 

Island within Manus Province, Papua New Guinea Manus IslandLocation of the Manus Island among the Admiralty IslandsManus IslandGeographyCoordinates2°5′37.28″S 146°58′17.33″E / 2.0936889°S 146.9714806°E / -2.0936889; 146.9714806ArchipelagoAdmiralty IslandsArea2,100 km2 (810 sq mi)Length100 km (60 mi)Width30 km (19 mi)Highest elevation718 m (2356 ft)Highest pointMt. DremselAdministrationPapua New Guinea (...

Blue LockGambar sampul manga Blue Lock volume pertamaブルーロック(Burū Rokku)GenreOlahraga MangaPengarangMuneyuki KaneshiroIlustratorYūsuke NomuraPenerbitKodanshaPenerbit bahasa InggrisNA Kodansha USAImprintShōnen Magazine ComicsMajalahWeekly Shōnen MagazineDemografiShōnenTerbit1 Agustus 2018 – sekarangVolume26 (Daftar volume) Seri animeSutradaraTetsuaki Watanabe Shunsuke IshikawaSkenarioTaku KishimotoMusikJun MurayamaStudioEight BitPelisensiCrunchyroll SA/SEA MedialinkSaluranasl...

 

Australian actor and comedian This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Syd Heylen – news · newspapers · books · scholar · JSTOR (December 2014) (Lea...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!