<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nklein software &#187; tricks</title>
	<atom:link href="http://nklein.com/tags/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:03:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What Was Up With That Rotation Trick?</title>
		<link>http://nklein.com/2009/06/what-was-up-with-that-rotation-trick/</link>
		<comments>http://nklein.com/2009/06/what-was-up-with-that-rotation-trick/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:25:56 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Clifford Algebras]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=542</guid>
		<description><![CDATA[In my prior post about using Clifford algebras to do plane rotations, I finished with a non-intuitive step at the end.  Rather than multiplying on the right by an element representing a rotation of angle , I multiplied on the left by an element representing a rotation of angle  and multiplied on the [...]]]></description>
			<content:encoded><![CDATA[<p>In my prior post about <a href="http://nklein.com/2009/06/clifford-algebras-for-rotating-scaling-and-translating-the-plane/">using Clifford algebras to do plane rotations</a>, I finished with a non-intuitive step at the end.  Rather than multiplying on the right by an element representing a rotation of angle <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0004c76178a1d078888badee6891a8bd.png" title="\theta" style="vertical-align:-20%;" class="tex" alt="\theta" />, I multiplied on the left by an element representing a rotation of angle <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2d16913e1a4ec8f7e9b5f6ffcf80bc33.png" title="\frac{\theta}{2}" style="vertical-align:-20%;" class="tex" alt="\frac{\theta}{2}" /> and multiplied on the right by an element representing a rotation of angle <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_7a577a03310558ad008df0fbed789c2e.png" title="-\frac{\theta}{2}" style="vertical-align:-20%;" class="tex" alt="-\frac{\theta}{2}" />.</p>
<p>Why did I do this?  Well, I mentioned it would be awkward for the two-dimensional case, but that it will be important when we get to three or more dimensions.  Well, work for a moment with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2d16913e1a4ec8f7e9b5f6ffcf80bc33.png" title="\frac{\theta}{2}" style="vertical-align:-20%;" class="tex" alt="\frac{\theta}{2}" /> being a quarter rotation (ninety degrees, <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4dcb91d20c0d18d06a5312f11f63360a.png" title="\frac{\pi}{2}" style="vertical-align:-20%;" class="tex" alt="\frac{\pi}{2}" /> radians).  This means our total rotation is going to be a half turn (180 degrees, <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_45e9944b76bbb5b9e0dc513417fadf63.png" title="\pi" style="vertical-align:-20%;" class="tex" alt="\pi" /> radians).</p>
<p>For that <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2d16913e1a4ec8f7e9b5f6ffcf80bc33.png" title="\frac{\theta}{2}" style="vertical-align:-20%;" class="tex" alt="\frac{\theta}{2}" />, <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c169dbccac5c68843892501c8928b97f.png" title="r = e_1e_2" style="vertical-align:-20%;" class="tex" alt="r = e_1e_2" /> and so <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_6d5663c230568262d7c4bebb5114f2c3.png" title="\overline{r} = -e_1e_2" style="vertical-align:-20%;" class="tex" alt="\overline{r} = -e_1e_2" />.  Let&#8217;s just look at what it does to our unit vectors <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2c114902ec52372ed67af47f809ba7a0.png" title="e_1" style="vertical-align:-20%;" class="tex" alt="e_1" /> and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_49142e125cfa1b96bdd97397c41eb8ea.png" title="e_2" style="vertical-align:-20%;" class="tex" alt="e_2" /> to multiply on the left by <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_de3adc820dbc4655c45b5555765fe84b.png" title="r" style="vertical-align:-20%;" class="tex" alt="r" /> and on the right by <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_c3e378eef52a54860a6eca39bcf44568.png" title="\overline{r}" style="vertical-align:-20%;" class="tex" alt="\overline{r}" />.</p>
<p>For <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2c114902ec52372ed67af47f809ba7a0.png" title="e_1" style="vertical-align:-20%;" class="tex" alt="e_1" />, we get <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_5bb0059d1766f53dc18fe56a2aa4d291.png" title="-e_1e_2e_1e_1e_2 = -e_1e_2e_2 = -e_1" style="vertical-align:-20%;" class="tex" alt="-e_1e_2e_1e_1e_2 = -e_1e_2e_2 = -e_1" />.  Similarly, for <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_49142e125cfa1b96bdd97397c41eb8ea.png" title="e_2" style="vertical-align:-20%;" class="tex" alt="e_2" />, we get <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_0b26aeee70d44511c433107f8e7dcccf.png" title="-e_1e_2e_2e_1e_2 = -e_2" style="vertical-align:-20%;" class="tex" alt="-e_1e_2e_2e_1e_2 = -e_2" />.</p>
<p>So far, we were only working in two dimensions.  As such, there wasn&#8217;t any <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> to worry about.  But, what if there were?  What happens to the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_645f43d7c6169f257cafd2dc973d2421.png" title="z" style="vertical-align:-20%;" class="tex" alt="z" />-coordinate of something if you rotate things parallel to the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_f307a57d9bce0d77a4c713980fbf9c0f.png" title="xy" style="vertical-align:-20%;" class="tex" alt="xy" />-plane?  It remains unchanged.</p>
<p>Well, what would happen if we multiplied <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> on the right by <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_118ba1241cdfb6f5184e44684f0036f2.png" title="\cos\theta + \sin\theta e_1e_2" style="vertical-align:-20%;" class="tex" alt="\cos\theta + \sin\theta e_1e_2" />?  We would end up with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_9df448d6c524e1fdb525a41ccfc61365.png" title="\cos\theta e_3 + \sin\theta e_3e_1e_2 = \cos\theta e_3 + \sin\theta e_1e_2e_3" style="vertical-align:-20%;" class="tex" alt="\cos\theta e_3 + \sin\theta e_3e_1e_2 = \cos\theta e_3 + \sin\theta e_1e_2e_3" />.  We&#8217;ve ended up scaling <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> and adding in a trivector <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_dacb1085506e5f4b7785c367531a82e4.png" title="e_1e_2e_3" style="vertical-align:-20%;" class="tex" alt="e_1e_2e_3" />.  We&#8217;ve made a mess.</p>
<p>Let&#8217;s try it instead with our trick.  We&#8217;re going to start with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_713f978db7752c0401887189100dbd3a.png" title="-e_1e_2e_3e_1e_2" style="vertical-align:-20%;" class="tex" alt="-e_1e_2e_3e_1e_2" />.  Every time we transpose elements with different subscripts, we flip the sign.  Every time we get two elements next to each other with the same subscript, they cancel out.  So, switching the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> with the second <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2c114902ec52372ed67af47f809ba7a0.png" title="e_1" style="vertical-align:-20%;" class="tex" alt="e_1" />, we get <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_b3404e11f3c64cdf3f0c8188fe467fb6.png" title="e_1e_2e_1e_3e_2" style="vertical-align:-20%;" class="tex" alt="e_1e_2e_1e_3e_2" />.  From there, we can switch the first two elements to get <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_1ba103eb0c8e6a07ee5a81dc15127190.png" title="-e_2e_1e_1e_3e_2" style="vertical-align:-20%;" class="tex" alt="-e_2e_1e_1e_3e_2" /> which is just <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_098e8b34f70bf74ac7bea1e763b862ec.png" title="-e_2e_3e_2" style="vertical-align:-20%;" class="tex" alt="-e_2e_3e_2" />.  We can switch the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> with the second <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_49142e125cfa1b96bdd97397c41eb8ea.png" title="e_2" style="vertical-align:-20%;" class="tex" alt="e_2" /> to get: <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_ad640c7b1d839d4e5bf8e3f66d23ffe6.png" title="e_2e_2e_3" style="vertical-align:-20%;" class="tex" alt="e_2e_2e_3" /> which is just <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" />.  So, our trick leaves <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_aafe61a61cb0ec96dc0785643f45904c.png" title="e_3" style="vertical-align:-20%;" class="tex" alt="e_3" /> unchanged.</p>
<p>In the above, there is nothing special about the subscript three.  It would work for any subscript except one or two.  So, the trick allows us to break the rotation up into two parts that still do what we want with <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2c114902ec52372ed67af47f809ba7a0.png" title="e_1" style="vertical-align:-20%;" class="tex" alt="e_1" /> and <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_49142e125cfa1b96bdd97397c41eb8ea.png" title="e_2" style="vertical-align:-20%;" class="tex" alt="e_2" /> but leave our other directions unchanged (or, maybe it&#8217;s easier to think of them as changing them and then changing them right back).</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/06/what-was-up-with-that-rotation-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
