{"id":114,"date":"2009-07-10T17:29:27","date_gmt":"2009-07-10T22:29:27","guid":{"rendered":"http:\/\/stoney.sb.org\/wordpress\/?p=114"},"modified":"2009-07-10T17:33:00","modified_gmt":"2009-07-10T22:33:00","slug":"2d-matrix-decomposition","status":"publish","type":"post","link":"https:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/","title":{"rendered":"2D Matrix Decomposition"},"content":{"rendered":"<p><a href=\"\/mm\/2dMatrixDecomposition.html\" target=\"_blank\">This<\/a> demonstrates the polar decomposition of 2D matrices into their angle, scale, and shear components. The polarDecomp algorithm is taken from Shoemake &amp; Duff &#8220;<a href=\"http:\/\/www.cs.wisc.edu\/graphics\/Courses\/838-s2002\/Papers\/polar-decomp.pdf\" target=\"_blank\">Matrix Animation and Polar Decomposition<\/a>&#8220;, 1992.<\/p>\n<p><!--more--><\/p>\n<p>I found that the formula for the polar decomposition, on page 3, produces rotation matrices that don&#8217;t account for diagonal axis flipping (swapping x with y). The article seems to factor out the flipping, but I didn&#8217;t want to have a fourth component. Removing the sign(det(M)) factor eliminated this problem by incorporating the flipping into the rotation matrix.<\/p>\n<p>It&#8217;s very desirable to decompose a matrix generated by {angle, scale, shear} back into the same part values, but this happens only when scale is positive and shear is zero. If not, the rotation is affected. At least, the parts are stable once derived from the first matrix. This may help in UI, and certainly in interpolation.<\/p>\n<p><a href=\"\/mm\/2dMatrixDecomposition.html\" target=\"_blank\">This page<\/a> is a Mathematica-generated HTML file, with CSS that I tweaked. Unfortunately, it shows Mathematica code as images, to preserve the original appearance. The original Mathematica notebook is <a href=\"\/mm\/2dMatrixDecomposition.nb\" target=\"_blank\">here<\/a>. If you don&#8217;t have Mathematica, you can view it using the free <a href=\"http:\/\/www.wolfram.com\/products\/player\/\" target=\"_blank\">Mathematica Player<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This demonstrates the polar decomposition of 2D matrices into their angle, scale, and shear components. The polarDecomp algorithm is taken from Shoemake &amp; Duff &#8220;Matrix Animation and Polar Decomposition&#8220;, 1992.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[17,20],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>2D Matrix Decomposition - Stoney&#039;s Zone<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"2D Matrix Decomposition - Stoney&#039;s Zone\" \/>\n<meta property=\"og:description\" content=\"This demonstrates the polar decomposition of 2D matrices into their angle, scale, and shear components. The polarDecomp algorithm is taken from Shoemake &amp; Duff &#8220;Matrix Animation and Polar Decomposition&#8220;, 1992.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/\" \/>\n<meta property=\"og:site_name\" content=\"Stoney&#039;s Zone\" \/>\n<meta property=\"article:published_time\" content=\"2009-07-10T22:29:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-07-10T22:33:00+00:00\" \/>\n<meta name=\"author\" content=\"stoney\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"stoney\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/\",\"url\":\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/\",\"name\":\"2D Matrix Decomposition - Stoney's Zone\",\"isPartOf\":{\"@id\":\"https:\/\/stoney.sb.org\/wordpress\/#website\"},\"datePublished\":\"2009-07-10T22:29:27+00:00\",\"dateModified\":\"2009-07-10T22:33:00+00:00\",\"author\":{\"@id\":\"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/d587bd16a4b79558c4f6e01c078fbdb1\"},\"breadcrumb\":{\"@id\":\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/stoney.sb.org\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"2D Matrix Decomposition\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/stoney.sb.org\/wordpress\/#website\",\"url\":\"https:\/\/stoney.sb.org\/wordpress\/\",\"name\":\"Stoney's Zone\",\"description\":\"Thoughts about stuff\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/stoney.sb.org\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/d587bd16a4b79558c4f6e01c078fbdb1\",\"name\":\"stoney\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47ff741e5568d1283ae1d29cfa4248fa?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47ff741e5568d1283ae1d29cfa4248fa?s=96&d=mm&r=pg\",\"caption\":\"stoney\"},\"sameAs\":[\"http:\/\/\"],\"url\":\"https:\/\/stoney.sb.org\/wordpress\/author\/stoney\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"2D Matrix Decomposition - Stoney's Zone","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/","og_locale":"en_US","og_type":"article","og_title":"2D Matrix Decomposition - Stoney's Zone","og_description":"This demonstrates the polar decomposition of 2D matrices into their angle, scale, and shear components. The polarDecomp algorithm is taken from Shoemake &amp; Duff &#8220;Matrix Animation and Polar Decomposition&#8220;, 1992.","og_url":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/","og_site_name":"Stoney's Zone","article_published_time":"2009-07-10T22:29:27+00:00","article_modified_time":"2009-07-10T22:33:00+00:00","author":"stoney","twitter_card":"summary_large_image","twitter_misc":{"Written by":"stoney","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/","url":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/","name":"2D Matrix Decomposition - Stoney's Zone","isPartOf":{"@id":"https:\/\/stoney.sb.org\/wordpress\/#website"},"datePublished":"2009-07-10T22:29:27+00:00","dateModified":"2009-07-10T22:33:00+00:00","author":{"@id":"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/d587bd16a4b79558c4f6e01c078fbdb1"},"breadcrumb":{"@id":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/stoney.sb.org\/wordpress\/2d-matrix-decomposition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stoney.sb.org\/wordpress\/"},{"@type":"ListItem","position":2,"name":"2D Matrix Decomposition"}]},{"@type":"WebSite","@id":"https:\/\/stoney.sb.org\/wordpress\/#website","url":"https:\/\/stoney.sb.org\/wordpress\/","name":"Stoney's Zone","description":"Thoughts about stuff","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stoney.sb.org\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/d587bd16a4b79558c4f6e01c078fbdb1","name":"stoney","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stoney.sb.org\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47ff741e5568d1283ae1d29cfa4248fa?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47ff741e5568d1283ae1d29cfa4248fa?s=96&d=mm&r=pg","caption":"stoney"},"sameAs":["http:\/\/"],"url":"https:\/\/stoney.sb.org\/wordpress\/author\/stoney\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p76dm1-1Q","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/posts\/114"}],"collection":[{"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":14,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/posts\/114\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stoney.sb.org\/wordpress\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}