https://wiki.beyondunreal.com/w/index.php?action=history&feed=atom Quaternion - Revision history 2017-11-17T22:48:17Z Revision history for this page on the wiki MediaWiki 1.25.1 https://wiki.beyondunreal.com/Quaternion?diff=46332&oldid=prev SeriousBarbie: "imarinary" -> "imaginary" 2016-05-14T20:54:36Z <p>&quot;imarinary&quot; -&gt; &quot;imaginary&quot;</p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 20:54, 14 May 2016</td> </tr><tr><td colspan="2" class="diff-lineno" id="L19" >Line 19:</td> <td colspan="2" class="diff-lineno">Line 19:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Conjugate quaternion===</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Conjugate quaternion===</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Quaterions are &quot;hypercomplex&quot; numbers. Like &quot;normal&quot; complex numbers with one <del class="diffchange diffchange-inline">imarinary </del>component, quaternions define the conjugate quaternion &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; or x&lt;sup&gt;*&lt;/sup&gt;:</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Quaterions are &quot;hypercomplex&quot; numbers. Like &quot;normal&quot; complex numbers with one <ins class="diffchange diffchange-inline">imaginary </ins>component, quaternions define the conjugate quaternion &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; or x&lt;sup&gt;*&lt;/sup&gt;:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = (x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = (x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> </table> SeriousBarbie https://wiki.beyondunreal.com/Quaternion?diff=46313&oldid=prev Wormbo: /* Definition */ Added subheadings to visually break up the section for easier reading, added a few details 2016-03-12T19:19:41Z <p>‎<span dir="auto"><span class="autocomment">Definition: </span> Added subheadings to visually break up the section for easier reading, added a few details</span></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 19:19, 12 March 2016</td> </tr><tr><td colspan="2" class="diff-lineno" id="L6" >Line 6:</td> <td colspan="2" class="diff-lineno">Line 6:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Generally a quaternion is a four-dimensional value that is written as either x = x&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;1&lt;/sub&gt;'''i''' + x&lt;sub&gt;2&lt;/sub&gt;'''j''' + x&lt;sub&gt;3&lt;/sub&gt;'''k''' or as x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;), where x&lt;sub&gt;0&lt;/sub&gt; is called the real or scalar part Re(x) and (x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;) is the imaginary or vector part Im(x). If the vector part is zero, the quaternion is called real, while a quaternion with a zero scalar part is called a pure imaginary quaternion. Real quaternions (x&lt;sub&gt;0&lt;/sub&gt;, 0, 0, 0) could also be written as x&lt;sub&gt;0&lt;/sub&gt;+ 0'''i''' + 0'''j''' + 0'''k''' = x&lt;sub&gt;0&lt;/sub&gt;.</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Generally a quaternion is a four-dimensional value that is written as either x = x&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;1&lt;/sub&gt;'''i''' + x&lt;sub&gt;2&lt;/sub&gt;'''j''' + x&lt;sub&gt;3&lt;/sub&gt;'''k''' or as x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;), where x&lt;sub&gt;0&lt;/sub&gt; is called the real or scalar part Re(x) and (x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;) is the imaginary or vector part Im(x). If the vector part is zero, the quaternion is called real, while a quaternion with a zero scalar part is called a pure imaginary quaternion. Real quaternions (x&lt;sub&gt;0&lt;/sub&gt;, 0, 0, 0) could also be written as x&lt;sub&gt;0&lt;/sub&gt;+ 0'''i''' + 0'''j''' + 0'''k''' = x&lt;sub&gt;0&lt;/sub&gt;.</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">===Additive operations===</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Addition, subtraction and negation of quaternions is defined the same way as for vectors:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Addition, subtraction and negation of quaternions is defined the same way as for vectors:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x + y = y + x = (x&lt;sub&gt;0&lt;/sub&gt;+ y&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;+ y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;+ y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;+ y&lt;sub&gt;3&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x + y = y + x = (x&lt;sub&gt;0&lt;/sub&gt;+ y&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;+ y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;+ y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;+ y&lt;sub&gt;3&lt;/sub&gt;)</div></td></tr> <tr><td colspan="2" class="diff-lineno" id="L11" >Line 11:</td> <td colspan="2" class="diff-lineno">Line 12:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* -x = (-x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* -x = (-x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The same goes for multiplication with a scalar value and scalar multiplication of two quaternions:</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">===Scalar multiplication===</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The same goes for multiplication with <ins class="diffchange diffchange-inline">and division by </ins>a scalar value <ins class="diffchange diffchange-inline">''a'' </ins>and <ins class="diffchange diffchange-inline">&quot;</ins>scalar multiplication<ins class="diffchange diffchange-inline">&quot; </ins>of two quaternions <ins class="diffchange diffchange-inline">''x'' and ''y''</ins>:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* a &amp;middot; x = x &amp;middot; a = (a &amp;middot; x&lt;sub&gt;0&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;1&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;2&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;3&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* a &amp;middot; x = x &amp;middot; a = (a &amp;middot; x&lt;sub&gt;0&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;1&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;2&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;3&lt;/sub&gt;)</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* x / a = x &amp;middot; 1/a = 1/a &amp;middot; x = x &amp;middot; a&lt;sup&gt;-1&lt;/sup&gt; = (x&lt;sub&gt;0&lt;/sub&gt; / a, x&lt;sub&gt;1&lt;/sub&gt; / a, x&lt;sub&gt;2&lt;/sub&gt; / a, x&lt;sub&gt;3&lt;/sub&gt; / a)</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x &amp;middot; y = y &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x &amp;middot; y = y &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Like complex numbers, quaternions define the conjugate quaternion &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; or x&lt;sup&gt;*&lt;/sup&gt;:</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">===Conjugate quaternion===</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Quaterions are &quot;hypercomplex&quot; numbers. </ins>Like <ins class="diffchange diffchange-inline">&quot;normal&quot; </ins>complex numbers <ins class="diffchange diffchange-inline">with one imarinary component</ins>, quaternions define the conjugate quaternion &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; or x&lt;sup&gt;*&lt;/sup&gt;:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = (x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = (x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">===Hamilton product===</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>A quite unique operation of quaternions is the Hamilton product, i.e. the multiplication of two quaternions that yields a quaternion again. This one is special, because unlike addition or scalar product, it is ''not'' commutative.</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>A quite unique operation of quaternions is the Hamilton product, i.e. the multiplication of two quaternions that yields a quaternion again. This one is special, because unlike addition or scalar product, it is ''not'' commutative.</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x y = (x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x y = (x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt;)</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Now that looks vile. But if you express the quaternions as a combination of a scalar and a vector part, i.e. x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;), you can express quaternion multiplication using the 3D vector scalar <del class="diffchange diffchange-inline">and </del>cross <del class="diffchange diffchange-inline">products</del>:</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Now that looks vile. But if you express the quaternions as a combination of a scalar and a vector part, i.e. x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;), you can express quaternion multiplication using the 3D vector scalar <ins class="diffchange diffchange-inline">product &quot;&amp;middot;&quot;, </ins>cross <ins class="diffchange diffchange-inline">product &quot;&amp;#x2a2f;&quot; and vector multiplication by a scalar value</ins>:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x y = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;)(y&lt;sub&gt;0&lt;/sub&gt;, y&lt;sub&gt;V&lt;/sub&gt;) = (x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;- x&lt;sub&gt;V&lt;/sub&gt;&amp;middot; y&lt;sub&gt;V&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;V&lt;/sub&gt; + x&lt;sub&gt;V&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt;)</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x y = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;)(y&lt;sub&gt;0&lt;/sub&gt;, y&lt;sub&gt;V&lt;/sub&gt;) = (x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;- x&lt;sub&gt;V&lt;/sub&gt;&amp;middot; y&lt;sub&gt;V&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;V&lt;/sub&gt; + x&lt;sub&gt;V&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt;)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This representation also easily shows that x y &amp;ne; y x, because x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt; = -(y&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; x&lt;sub&gt;V&lt;/sub&gt;).</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This representation also easily shows that x y &amp;ne; y x, because x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt; = -(y&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; x&lt;sub&gt;V&lt;/sub&gt;).</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>A quaternion's norm ||x||&lt;sup&gt;2&lt;/sup&gt; is defined <del class="diffchange diffchange-inline">as</del>:</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Now if you recall that a &quot;real quaternion&quot; (vector part zero) is essentially the same as a real number, you can easily see that the quaterion scalar product is basically a special, commutative case of the Hamilton product. In fact, even the multiplication of real numbers could be seen a special case of the Hamilton product, which both quaternions having zero vector parts.</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Another important special case is the Hamilton product of two unit quaterions: The result of such a multiplication is a unit quaternion again.</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">===Norm===</ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>A quaternion's norm ||x||&lt;sup&gt;2&lt;/sup&gt; <ins class="diffchange diffchange-inline">(its &quot;length&quot;) </ins>is defined <ins class="diffchange diffchange-inline">similarly to a vector's length</ins>:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* ||x||&lt;sup&gt;2&lt;/sup&gt; = x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; x = x &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;2&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;3&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* ||x||&lt;sup&gt;2&lt;/sup&gt; = x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; x = x &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;2&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;3&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;</div></td></tr> <tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The value ||x|| is called the length or absolute value of the quaternion. Its square is equal to the scalar product of the quaternion with itself or the Hamilton product with its conjugate quaternion. Multiplying a quaternion by its conjugate results in the vector part becoming zero, which is why the resulting quaternion in the above equation can be considered a scalar number. (Remember that quaternions are hypercomplex numbers, not euclidean vectors. Real numbers are valid quaternion values with the vector part being zero.)</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The value ||x|| is called the length or absolute value of the quaternion. Its square is equal to the scalar product of the quaternion with itself or the Hamilton product with its conjugate quaternion<ins class="diffchange diffchange-inline">. A quaternion with the norm 1 is called a '''unit quaternion'''</ins>. Multiplying a quaternion by its conjugate results in the vector part becoming zero, which is why the resulting quaternion in the above equation can be considered a scalar number. (Remember that quaternions are hypercomplex numbers, not euclidean vectors. Real numbers are valid quaternion values with the vector part being zero.)</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">===Inverse===</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>A quaternion's multiplicative inverse, the reciprocal, x&lt;sup&gt;-1&lt;/sup&gt; is defined as the value that satisfies the equation x x&lt;sup&gt;-1&lt;/sup&gt; = 1:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>A quaternion's multiplicative inverse, the reciprocal, x&lt;sup&gt;-1&lt;/sup&gt; is defined as the value that satisfies the equation x x&lt;sup&gt;-1&lt;/sup&gt; = 1:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x&lt;sup&gt;-1&lt;/sup&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / (x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt;) = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / ||x||&lt;sup&gt;2&lt;/sup&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* x&lt;sup&gt;-1&lt;/sup&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / (x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt;) = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / ||x||&lt;sup&gt;2&lt;/sup&gt;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Note that the fractional notation is avoided if the denominator is not a real number because the notation itself is ambiguous since it does not specify if the denominator's reciprocal must be multiplied to the left or to the right of the numerator and quaternion multiplication is not commutative.</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Note that the fractional notation is avoided if the denominator is not a real number because the notation itself is ambiguous since it does not specify if the denominator's reciprocal must be multiplied to the left or to the right of the numerator and quaternion multiplication is not commutative.</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">An important special case of the inverse are unit quaterions. Because their norm is already 1, the inverse of a unit quaterion is the same as the conjugate of that unit quaternion.</ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Quaternion rotation==</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Quaternion rotation==</div></td></tr> </table> Wormbo https://wiki.beyondunreal.com/Quaternion?diff=45476&oldid=prev Wormbo: Created page with 'wp:Quaternions| are a mathematical construct that could be seen as an extension of the wp:complex numbers| with three different imaginary units or as a combination of a s…' 2013-09-21T15:24:18Z <p>Created page with &#039;<a href="http://en.wikipedia.org/wiki/Quaternions" class="extiw" title="wp:Quaternions">wp:Quaternions</a> are a mathematical construct that could be seen as an extension of the <a href="http://en.wikipedia.org/wiki/complex_numbers" class="extiw" title="wp:complex numbers">wp:complex numbers</a> with three different imaginary units or as a combination of a s…&#039;</p> <p><b>New page</b></p><div>[[wp:Quaternions|Quaternions]] are a mathematical construct that could be seen as an extension of the [[wp:complex numbers|complex numbers]] with three different imaginary units or as a combination of a scalar value and a three-dimensional [[vector]]. A special subset of the quaternions, the unit quaternions, can be used to represent rotations in 3D space.<br /> <br /> [[Category:Programming articles]]<br /> <br /> ==Definition==<br /> Generally a quaternion is a four-dimensional value that is written as either x = x&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;1&lt;/sub&gt;'''i''' + x&lt;sub&gt;2&lt;/sub&gt;'''j''' + x&lt;sub&gt;3&lt;/sub&gt;'''k''' or as x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;), where x&lt;sub&gt;0&lt;/sub&gt; is called the real or scalar part Re(x) and (x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;) is the imaginary or vector part Im(x). If the vector part is zero, the quaternion is called real, while a quaternion with a zero scalar part is called a pure imaginary quaternion. Real quaternions (x&lt;sub&gt;0&lt;/sub&gt;, 0, 0, 0) could also be written as x&lt;sub&gt;0&lt;/sub&gt;+ 0'''i''' + 0'''j''' + 0'''k''' = x&lt;sub&gt;0&lt;/sub&gt;.<br /> <br /> Addition, subtraction and negation of quaternions is defined the same way as for vectors:<br /> * x + y = y + x = (x&lt;sub&gt;0&lt;/sub&gt;+ y&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;+ y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;+ y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;+ y&lt;sub&gt;3&lt;/sub&gt;)<br /> * x - y = -y + x = (x&lt;sub&gt;0&lt;/sub&gt;- y&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;1&lt;/sub&gt;- y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;- y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;- y&lt;sub&gt;3&lt;/sub&gt;)<br /> * -x = (-x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)<br /> <br /> The same goes for multiplication with a scalar value and scalar multiplication of two quaternions:<br /> * a &amp;middot; x = x &amp;middot; a = (a &amp;middot; x&lt;sub&gt;0&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;1&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;2&lt;/sub&gt;, a &amp;middot; x&lt;sub&gt;3&lt;/sub&gt;)<br /> * x &amp;middot; y = y &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;<br /> <br /> Like complex numbers, quaternions define the conjugate quaternion &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; or x&lt;sup&gt;*&lt;/sup&gt;:<br /> * &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = (x&lt;sub&gt;0&lt;/sub&gt;, -x&lt;sub&gt;1&lt;/sub&gt;, -x&lt;sub&gt;2&lt;/sub&gt;, -x&lt;sub&gt;3&lt;/sub&gt;)<br /> <br /> A quite unique operation of quaternions is the Hamilton product, i.e. the multiplication of two quaternions that yields a quaternion again. This one is special, because unlike addition or scalar product, it is ''not'' commutative.<br /> * x y = (x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; - x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;&amp;middot; y&lt;sub&gt;3&lt;/sub&gt; + x&lt;sub&gt;1&lt;/sub&gt;&amp;middot; y&lt;sub&gt;2&lt;/sub&gt; - x&lt;sub&gt;2&lt;/sub&gt;&amp;middot; y&lt;sub&gt;1&lt;/sub&gt; + x&lt;sub&gt;3&lt;/sub&gt;&amp;middot; y&lt;sub&gt;0&lt;/sub&gt;)<br /> Now that looks vile. But if you express the quaternions as a combination of a scalar and a vector part, i.e. x = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;), you can express quaternion multiplication using the 3D vector scalar and cross products:<br /> * x y = (x&lt;sub&gt;0&lt;/sub&gt;, x&lt;sub&gt;V&lt;/sub&gt;)(y&lt;sub&gt;0&lt;/sub&gt;, y&lt;sub&gt;V&lt;/sub&gt;) = (x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;- x&lt;sub&gt;V&lt;/sub&gt;&amp;middot; y&lt;sub&gt;V&lt;/sub&gt;, x&lt;sub&gt;0&lt;/sub&gt;y&lt;sub&gt;V&lt;/sub&gt; + x&lt;sub&gt;V&lt;/sub&gt;y&lt;sub&gt;0&lt;/sub&gt;+ x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt;)<br /> This representation also easily shows that x y &amp;ne; y x, because x&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; y&lt;sub&gt;V&lt;/sub&gt; = -(y&lt;sub&gt;V&lt;/sub&gt;&amp;#x2a2f; x&lt;sub&gt;V&lt;/sub&gt;).<br /> <br /> A quaternion's norm ||x||&lt;sup&gt;2&lt;/sup&gt; is defined as:<br /> * ||x||&lt;sup&gt;2&lt;/sup&gt; = x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; x = x &amp;middot; x = x&lt;sub&gt;0&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;1&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;2&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;+ x&lt;sub&gt;3&lt;/sub&gt;&lt;sup&gt;2&lt;/sup&gt;<br /> The value ||x|| is called the length or absolute value of the quaternion. Its square is equal to the scalar product of the quaternion with itself or the Hamilton product with its conjugate quaternion. Multiplying a quaternion by its conjugate results in the vector part becoming zero, which is why the resulting quaternion in the above equation can be considered a scalar number. (Remember that quaternions are hypercomplex numbers, not euclidean vectors. Real numbers are valid quaternion values with the vector part being zero.)<br /> <br /> A quaternion's multiplicative inverse, the reciprocal, x&lt;sup&gt;-1&lt;/sup&gt; is defined as the value that satisfies the equation x x&lt;sup&gt;-1&lt;/sup&gt; = 1:<br /> * x&lt;sup&gt;-1&lt;/sup&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / (x &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt;) = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / ||x||&lt;sup&gt;2&lt;/sup&gt;<br /> Note that the fractional notation is avoided if the denominator is not a real number because the notation itself is ambiguous since it does not specify if the denominator's reciprocal must be multiplied to the left or to the right of the numerator and quaternion multiplication is not commutative.<br /> <br /> ==Quaternion rotation==<br /> The basis for expression rotations using quaternions are unit quaternions, i.e. quaternions with a length of 1, and pure imaginary quaternions, i.e. quaternions of the form (0, x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt;). Pure imaginary quaternions are used to represent vectors that will be rotated around the origin in some way, while unit quaternions define the rotation axis and angle. To apply a rotation defined by quaternion r to a vector defined by quaternion v, all you need to do is calculate the quaternion product r v r&lt;sup&gt;-1&lt;/sup&gt;.<br /> <br /> A property of quaternion multiplication is that the length of the resulting quaternion is the same as the product of the lengths of the two original quaternions. Consequently the product of two unit quaternions will be another unit quaternions. If those two unit quaternions represent 3D rotations, the resulting unit quaternion will represent the combination of these two rotations in the reverse order. The product r&lt;sub&gt;1&lt;/sub&gt; r&lt;sub&gt;2&lt;/sub&gt; represents a rotation achieved by first applying r&lt;sub&gt;2&lt;/sub&gt;, then r&lt;sub&gt;1&lt;/sub&gt;.<br /> <br /> The vector to rotate can be converted to a quaternion simply by using the vector as the quaternion's vector part and zero as the scalar part. A rotation quaternion is calculated from a rotation axis and an angle. Given the rotation axis as unit vector u and the rotation angle &amp;alpha; between 0 and 2&amp;pi;, the rotation quaternion r is calculated as r = (cos &amp;alpha;/2, u sin &amp;alpha;/2).<br /> <br /> ==UnrealScript functions==<br /> The {{classgames|Object|ne=UE1}} class provides several functions and (in UE3) operators for working with quaternions. It defines the [[struct]] '''Quat''' with the components W, X, Y and Z as data type for a quaternion value. Unreal Engine 3 also defines the binary operators &lt;code&gt;+&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt;, and like with every struct you can compare Quat values for equality and inequality with the &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;!=&lt;/code&gt; operators.<br /> <br /> The Quat struct type is subject to data reduction during replication. The engine assumes that you replicate only unit quaternions and only replicates the X, Y and Z components. The W component will be calculated on the remote side to get a unit quaternion again.<br /> <br /> Quaternion rotation is used in rigid body physics calculations both in Unreal Engine 2 (PHYS_Karma) and Unreal Engine 3 (PHYS_RigidBody). The rigid body physics state of an actor is composed of a vector for the location, a quaternion for the rotation and two vectors for linear and angular velocity.<br /> <br /> ===QuatProduct(Quat, Quat)===<br /> Calculates the Hamilton product of the two quaternions and returns the resulting quaternion value.<br /> <br /> ===QuatDot(Quat, Quat)===<br /> Calculates the scalar product of the two quaternions and returns the resulting float value. This function is not available in Unreal Engine 2.<br /> <br /> ===QuatInvert(Quat)===<br /> Returns the conjugate quaternion. Note that due to x&lt;sup&gt;-1&lt;/sup&gt; = &lt;span style=&quot;text-decoration: overline;&quot;&gt;x&lt;/span&gt; / ||x||&lt;sup&gt;2&lt;/sup&gt; the conjugate quaternion of a unit quaternion also is its reciprocal.<br /> <br /> ===QuatRotateVector(Quat, Vector)===<br /> Rotates the specified vector by the given rotation quaternion and returns the resulting vector value. Note that the result will only be actually the rotated vector if the quaternion is a unit quaternion.<br /> <br /> ===QuatFindBetween(Vector, Vector)===<br /> Calculates the quaternion that will rotate the first vector onto the second. It does so by calculating the rotation axis and angle between the vectors using the cross product and scalar product. Note that it short-circuits if the cross product is zero. In that case, whether the vectors point in the same or opposite directions, it always returns the identity quaternion (1,0,0,0), even though opposite direction vectors would require a rotation by 180° around an arbitrary rotation axis perpendicular to the vectors.<br /> <br /> ===QuatFromAxisAndAngle(Vector, float)===<br /> Creates a rotation quaternion from the specifies axis vector and rotation angle in radians. The vector will be normalized for this calculation but must not be zero.<br /> <br /> ===QuatFromRotator(Rotator)===<br /> Calculates a rotation quaternion that represents the same rotation as the specified [[Rotator]] value.<br /> <br /> ===QuatToRotator(Quat)===<br /> Calculates a Rotator value that represents the same rotation as the specified rotation quaternion. This basically applies the quaternion rotation to the X, Y and Z axis vectors and uses the OrthoRotation function on the resulting vectors to calculate the Rotator value.<br /> <br /> ===QuatSlerp(Quat, Quat, float)===<br /> Performs '''s'''pherical '''l'''inear int'''erp'''olation on the two rotation quaternions, using the float value as blend alpha. A value of 0.0 maps to the first quaternion, a value of 1.0 to the second, while 0.5 is halfway between them.<br /> <br /> {{navbox unrealscript}}</div> Wormbo