{"id":268,"date":"2010-07-15T03:08:54","date_gmt":"2010-07-14T19:08:54","guid":{"rendered":"http:\/\/www.cgdev.net\/blog\/?p=268"},"modified":"2024-04-11T08:54:50","modified_gmt":"2024-04-11T00:54:50","slug":"%e6%97%8b%e8%bd%ac%e7%9f%a9%e9%98%b5","status":"publish","type":"post","link":"https:\/\/www.cgdev.net\/blog\/268.html","title":{"rendered":"Rotation"},"content":{"rendered":"<p>\u2606.\u00a0 Rotation about the x, y, z axis<\/p>\n<p>\\begin{align}<br \/>\nR_x(\\theta) &amp;=<br \/>\n\\begin{bmatrix}<br \/>\n1 &amp; 0 &amp; 0\\\\<br \/>\n0 &amp; \\cos\\theta &amp; -\\sin\\theta\\\\<br \/>\n0 &amp; \\sin\\theta &amp; \\cos\\theta<br \/>\n\\end{bmatrix} = exp \\left (\\theta<br \/>\n\\begin{bmatrix}<br \/>\n0 &amp; 0 &amp; 0\\\\<br \/>\n0 &amp; 0 &amp; -1\\\\<br \/>\n0 &amp; 1 &amp; 0<br \/>\n\\end{bmatrix} \\right )<br \/>\n\\\\ \\\\ \\\\<br \/>\nR_y(\\theta) &amp;=<br \/>\n\\begin{bmatrix}<br \/>\n\\cos\\theta &amp; 0 &amp; \\sin\\theta\\\\<br \/>\n0 &amp; 1 &amp; 0\\\\<br \/>\n-\\sin\\theta &amp; 0 &amp; \\cos\\theta<br \/>\n\\end{bmatrix} = exp \\left (\\theta<br \/>\n\\begin{bmatrix}<br \/>\n0 &amp; 0 &amp; 1 \\\\<br \/>\n0 &amp; 0 &amp; 0\\\\<br \/>\n-1 &amp; 0 &amp; 0<br \/>\n\\end{bmatrix} \\right )<br \/>\n\\\\ \\\\ \\\\<br \/>\nR_z(\\theta) &amp;=<br \/>\n\\begin{bmatrix}<br \/>\n\\cos\\theta &amp; -\\sin\\theta &amp; 0\\\\<br \/>\n\\sin\\theta &amp; \\cos\\theta &amp; 0\\\\<br \/>\n0 &amp; 0 &amp; 1<br \/>\n\\end{bmatrix} = exp \\left ( \\theta<br \/>\n\\begin{bmatrix}<br \/>\n0 &amp; -1 &amp; 0\\\\<br \/>\n1 &amp; 0 &amp; 0\\\\<br \/>\n0 &amp; 0 &amp; 0<br \/>\n\\end{bmatrix} \\right )<br \/>\n\\end{align}<\/p>\n<p>\u2606.\u00a0 Rotation about an arbitrary axis. Let \\(l\\) be the unit vector and \\(\u03b8\\) be the angle.<br \/>\n1. The exponential map. We can derive the <a href=\"https:\/\/www.cgdev.net\/blog\/485.html\" rel=\"noopener\" target=\"_blank\">Rodrigues&#8217; rotation formula<\/a>. If \u03a9 is a matrix, we define the exponential of \u03a9, denoted \\(e^\u03a9\\). Let \\(\u00a0 \\theta^2 =\u00a0\u03c9_x^2 +\u00a0\u03c9_y^2 + \u03c9_z^2 \\)<\/p>\n<p>\\begin{align}<br \/>\n\\theta ad(l) = ad(\u03c9) = \u03a9 =<br \/>\n\\begin{bmatrix}<br \/>\n0 &amp; -\u03c9_z &amp; \u03c9_y \\\\<br \/>\n\u03c9_z &amp; 0 &amp; -\u03c9_x \\\\<br \/>\n-\u03c9_y &amp; \u03c9_x &amp; 0<br \/>\n\\end{bmatrix}<br \/>\n\\end{align}<\/p>\n<p>\\begin{align}<br \/>\np_1 &amp;= e^{\\theta ad(l)} p = e^\u03a9 p \\\\<br \/>\n&amp;= ( I_3 + \\frac{\\sin \\theta}{\\theta} \u03a9 + \\frac{1 &#8211; \\cos \\theta}{\\theta^2} \u03a9^2 ) p\\\\<br \/>\n&amp;= ( I_3 + \\sin \\theta\u00a0ad(l) + ( 1 &#8211; \\cos \\theta ) ad^2 (l) ) p\\\\<br \/>\n&amp;= p + \\sin \\theta ad(l) p + ( 1 &#8211; \\cos \\theta )ad^2 (l) p \\\\<br \/>\n&amp;= p + \\sin \\theta (l \\times p) +( 1 &#8211; \\cos \\theta )l \\times ( l \\times p ) \\\\<br \/>\n&amp;= p + \\sin \\theta (l \\times p) -(1 &#8211; \\cos \\theta )l \\times p \\times l \\\\<br \/>\n&amp;= p + \\sin \\theta (l \\times p) -(1 &#8211; \\cos \\theta )((l\\cdot l)p &#8211; (l \\cdot p)l ) \\\\<br \/>\n&amp;= p + \\sin \\theta (l \\times p) -(1 &#8211; \\cos \\theta )(p &#8211; (l \\cdot p)l ) \\\\<br \/>\n&amp;= p \\cos \\theta + \\sin \\theta (l \\times p) + (1 &#8211; \\cos \\theta )(l \\cdot p)l )<br \/>\n\\end{align}<\/p>\n<p>2.\u00a0 Unit quaternions are in bijection with points of the real 3-sphere \\(S^3\\) in \\(\\mathbb R^4\\). Let \\( v =\u00a0l\\sin(\\frac{\\theta}{2}) \\)\uff0c\\( w=\\cos(\\frac{\\theta}{2}) \\)<\/p>\n<p>\\begin{align}<br \/>\nq &amp;= \\cos(\\frac{\\theta}{2})+l\\sin(\\frac{\\theta}{2}) = w + v\\\\<br \/>\np_1 &amp;= qpq^{-1} \\\\<br \/>\n&amp;= (w^{2} &#8211; v \\cdot v)p + 2w(v \\times p) + 2(v \\cdot p)v \\\\<br \/>\n&amp;= p+2w(v \\times p) +2v \\times (v \\times p)<br \/>\n\\end{align}<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2606.\u00a0 Rotation about the x, y, z axis \\begin{align} R_x(\\theta) &amp;= \\begin{bmatrix} 1 &amp; 0 &amp; 0\\\\ 0 &amp; \\cos\\theta &amp; -\\sin\\theta\\\\ 0 &amp; \\sin\\theta &amp; \\cos\\theta \\end{bmatrix} = exp \\left (\\theta \\begin{bmatrix} 0 &amp; 0 &amp; 0\\\\ 0 &amp; 0 &amp; -1\\\\ 0 &amp; 1 &amp; 0 \\end{bmatrix} \\right ) \\\\ \\\\ \\\\ R_y(\\theta) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[20],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-graphics","category-math","tag-geo"],"_links":{"self":[{"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":0,"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cgdev.net\/blog\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}