Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 350eb50c9ea7f887b47954b9fc238f01 > files > 123

libQGLViewer-doc-2.3.6-1.fc14.noarch.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libQGLViewer: Quaternion Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link rel="shortcut icon" href="../images/qglviewer.ico" type="image/x-icon" />
<link rel="icon" href="../images/qglviewer.icon.png" type="image/png" />
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="../index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>

      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  </div>
</div>
<div class="contents">
<h1>Quaternion Class Reference</h1><!-- doxytag: class="qglviewer::Quaternion" -->
<p>The Quaternion class represents 3D rotations and orientations.  
<a href="#_details">More...</a></p>

<p><a href="classqglviewer_1_1Quaternion-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Defining a Quaternion</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a65ed15cc19af958b5933b5c522f10e66">Quaternion</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ad0347716e801bcdeab909493817edc85">Quaternion</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;axis, double angle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a1b60be34a715145efc3b91e6dfba1634">Quaternion</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;from, const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;to)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a81ba24ffd95778f3ca4e51b2b9922f45">Quaternion</a> (double q0, double q1, double q2, double q3)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a71a4d1a3b760854468ff270a982e5f59">Quaternion</a> (const Quaternion &amp;Q)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ad20a1310f5fac88d5e00fa055e09fe72">operator=</a> (const Quaternion &amp;Q)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ad6bd25e80a18f6bd38ae5c4e5337b53b">setAxisAngle</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;axis, double angle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#abe7dd94e4fb48e0c8e0d994cac84064a">setValue</a> (double q0, double q1, double q2, double q3)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a1880f20e8080ee670b6a88ed0c7d69ac">setFromRotationMatrix</a> (const double m[3][3])</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a760617f082c950633b5642d2f60b2dd9">setFromRotatedBasis</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;X, const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;Y, const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;Z)</td></tr>
<tr><td colspan="2"><h2>Accessing values</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a46b7892fe36e140862b9c71e5cfe8292">getAxisAngle</a> (<a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;axis, float &amp;angle) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a605b34d1fc87b2ccaf49a45419c2e46f">operator[]</a> (int i) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#af1a8c9c4769161714a5a1a2c7fad446b">operator[]</a> (int i)</td></tr>
<tr><td colspan="2"><h2>Rotation computations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a0caef8e6e702101a45fdc0af3920c49d">operator*=</a> (const Quaternion &amp;q)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a5e2421069d88e576334e10f634625815">rotate</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;v) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a74d79bc1afcc02fdbfe0eb390c3546f5">inverseRotate</a> (const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;v) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a76b3ffdb188246ff6559069cb3f5b919">operator*</a> (const Quaternion &amp;a, const Quaternion &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a19ce6efe5ef2744c8293e8ba1a39b9e4">operator*</a> (const Quaternion &amp;q, const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;v)</td></tr>
<tr><td colspan="2"><h2>Inversion</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a7fa1616cc61c19a5efcc863c950f7f30">invert</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#abcdb1512395327f8236a4f4a4d4ff648">negate</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a05826e509c686f39baaec4656f1a7231">normalize</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ae347ecf6e0a78618e8fd1a3b9107df32">normalized</a> () const </td></tr>
<tr><td colspan="2"><h2>Associated matrix</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const GLdouble *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#aa12123cf45f68b9f7fe0526b70ab0047">matrix</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix</a> (GLdouble m[4][4]) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a15f0dc7596dc78437154302466ac3c0a">getMatrix</a> (GLdouble m[16]) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#aad37aa66da74be6fb8d9d66f059f0872">getRotationMatrix</a> (float m[3][3]) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const GLdouble *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a32992f152b7377da431c69f15384ed22">inverseMatrix</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix</a> (GLdouble m[4][4]) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a315cf039df621a101a953df20acc7155">getInverseMatrix</a> (GLdouble m[16]) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#ae1455acb1cbf59befe65295734d48c4a">getInverseRotationMatrix</a> (float m[3][3]) const </td></tr>
<tr><td colspan="2"><h2>Slerp interpolation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a4db67fbb8171a5e781b56404112cf848">log</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a5c546a33cc0c65f24b7e9c48e5069ba7">exp</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a755201c9a752fd892a3656a517b190e4">slerp</a> (const Quaternion &amp;a, const Quaternion &amp;b, float t, bool allowFlip=true)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a4b218b205d88a4dd50c8de38522b5812">squad</a> (const Quaternion &amp;a, const Quaternion &amp;tgA, const Quaternion &amp;tgB, const Quaternion &amp;b, float t)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a80d06247e39abf2980e56d2fe8c4bb83">dot</a> (const Quaternion &amp;a, const Quaternion &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#af4c74176967acca6e3947977351e1c68">lnDif</a> (const Quaternion &amp;a, const Quaternion &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a2a27d43a68da6c7c5243fe81e5a9d005">squadTangent</a> (const Quaternion &amp;before, const Quaternion &amp;center, const Quaternion &amp;after)</td></tr>
<tr><td colspan="2"><h2>XML representation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a87faf5efc96c9b5af85a611985b6618f">Quaternion</a> (const QDomElement &amp;element)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QDomElement&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement</a> (const QString &amp;name, QDomDocument &amp;document) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement</a> (const QDomElement &amp;element)</td></tr>
<tr><td colspan="2"><h2>Output stream</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a16d5f2f021103b05006b0c58fbd48796">operator&lt;&lt;</a> (std::ostream &amp;o, const <a class="el" href="classqglviewer_1_1Vec.html">qglviewer::Vec</a> &amp;)</td></tr>
<tr><td colspan="2"><h2>Random Quaternion</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static Quaternion&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Quaternion.html#a87d5e98d958fdc63100979fcff1d9976">randomQuaternion</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The Quaternion class represents 3D rotations and orientations. </p>
<p>The Quaternion is an appropriate (although not very intuitive) representation for 3D rotations and orientations. Many tools are provided to ease the definition of a Quaternion: see constructors, <a class="el" href="classqglviewer_1_1Quaternion.html#ad6bd25e80a18f6bd38ae5c4e5337b53b">setAxisAngle()</a>, <a class="el" href="classqglviewer_1_1Quaternion.html#a1880f20e8080ee670b6a88ed0c7d69ac">setFromRotationMatrix()</a>, <a class="el" href="classqglviewer_1_1Quaternion.html#a760617f082c950633b5642d2f60b2dd9">setFromRotatedBasis()</a>.</p>
<p>You can apply the rotation represented by the Quaternion to 3D points using <a class="el" href="classqglviewer_1_1Quaternion.html#a5e2421069d88e576334e10f634625815">rotate()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a74d79bc1afcc02fdbfe0eb390c3546f5">inverseRotate()</a>. See also the <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> class that represents a coordinate system and provides other conversion functions like <a class="el" href="classqglviewer_1_1Frame.html#ac706b338b08d9d7b511fd84d0b6ecf96">Frame::coordinatesOf()</a> and <a class="el" href="classqglviewer_1_1Frame.html#a05a3e18419f02427366a95b1e299f12e">Frame::transformOf()</a>.</p>
<p>You can apply the Quaternion <code>q</code> rotation to the OpenGL matrices using: </p>
<div class="fragment"><pre class="fragment">        glMultMatrixd(q.matrix());
        <span class="comment">// equvalent to glRotate(q.angle()*180.0/M_PI, q.axis().x, q.axis().y, q.axis().z);</span>
</pre></div><p>Quaternion is part of the <code>qglviewer</code> namespace, specify <code>qglviewer::Quaternion</code> or use the qglviewer namespace: </p>
<div class="fragment"><pre class="fragment"> <span class="keyword">using namespace </span>qglviewer; 
</pre></div><h3>Internal representation</h3>
<p>The internal representation of a Quaternion corresponding to a rotation around axis <code>axis</code>, with an angle <code>alpha</code> is made of four doubles q[i]: </p>
<div class="fragment"><pre class="fragment">        {q[0],q[1],q[2]} = sin(alpha/2) * {<a class="code" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis</a>[0],<a class="code" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis</a>[1],axis[2]}
        q[3] = cos(alpha/2)
</pre></div><p>Note that certain implementations place the cosine term in first position (instead of last here).</p>
<p>The Quaternion is always normalized, so that its <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a> is actually its conjugate.</p>
<p>See also the <a class="el" href="classqglviewer_1_1Vec.html" title="The Vec class represents 3D positions and 3D vectors.">Vec</a> and <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> classes' documentations. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a65ed15cc19af958b5933b5c522f10e66"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="a65ed15cc19af958b5933b5c522f10e66" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Default constructor, builds an identity rotation. </p>

</div>
</div>
<a class="anchor" id="ad0347716e801bcdeab909493817edc85"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="ad0347716e801bcdeab909493817edc85" args="(const Vec &amp;axis, double angle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>axis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>angle</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor from rotation axis (non null) and angle (in radians). See also <a class="el" href="classqglviewer_1_1Quaternion.html#ad6bd25e80a18f6bd38ae5c4e5337b53b">setAxisAngle()</a>. </p>

</div>
</div>
<a class="anchor" id="a1b60be34a715145efc3b91e6dfba1634"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="a1b60be34a715145efc3b91e6dfba1634" args="(const Vec &amp;from, const Vec &amp;to)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>to</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs a Quaternion that will rotate from the <code>from</code> direction to the <code>to</code> direction.</p>
<p>Note that this rotation is not uniquely defined. The selected axis is usually orthogonal to <code>from</code> and <code>to</code>, minimizing the rotation angle. This method is robust and can handle small or almost identical vectors. </p>

</div>
</div>
<a class="anchor" id="a81ba24ffd95778f3ca4e51b2b9922f45"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="a81ba24ffd95778f3ca4e51b2b9922f45" args="(double q0, double q1, double q2, double q3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor from the four values of a Quaternion. First three values are axis*sin(angle/2) and last one is cos(angle/2).</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The identity Quaternion is Quaternion(0,0,0,1) and <em>not</em> Quaternion(0,0,0,0) (which is not unitary). The default <a class="el" href="classqglviewer_1_1Quaternion.html#a65ed15cc19af958b5933b5c522f10e66">Quaternion()</a> creates such identity Quaternion. </dd></dl>

</div>
</div>
<a class="anchor" id="a71a4d1a3b760854468ff270a982e5f59"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="a71a4d1a3b760854468ff270a982e5f59" args="(const Quaternion &amp;Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>Q</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copy constructor. </p>

</div>
</div>
<a class="anchor" id="a87faf5efc96c9b5af85a611985b6618f"></a><!-- doxytag: member="qglviewer::Quaternion::Quaternion" ref="a87faf5efc96c9b5af85a611985b6618f" args="(const QDomElement &amp;element)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion </td>
          <td>(</td>
          <td class="paramtype">const QDomElement &amp;&nbsp;</td>
          <td class="paramname"> <em>element</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs a Quaternion from a <code>QDomElement</code> representing an XML code of the form </p>
<div class="fragment"><pre class="fragment"> &lt; anyTagName q0=<span class="stringliteral">&quot;..&quot;</span> q1=<span class="stringliteral">&quot;..&quot;</span> q2=<span class="stringliteral">&quot;..&quot;</span> q3=<span class="stringliteral">&quot;..&quot;</span> /&gt;
</pre></div><p>If one of these attributes is missing or is not a number, a warning is displayed and the associated value is respectively set to 0, 0, 0 and 1 (identity Quaternion).</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement()</a>. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a39bde10d142ce0cbc9614988ca0a0e59"></a><!-- doxytag: member="qglviewer::Quaternion::angle" ref="a39bde10d142ce0cbc9614988ca0a0e59" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float angle </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the angle (in radians) of the rotation represented by the Quaternion.</p>
<p>This value is always in the range [0-pi]. Larger rotational angles are obtained by inverting the <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a> direction.</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a46b7892fe36e140862b9c71e5cfe8292">getAxisAngle()</a>. </p>

</div>
</div>
<a class="anchor" id="a63f3f585fd25e9cb32700a26d54f8ee4"></a><!-- doxytag: member="qglviewer::Quaternion::axis" ref="a63f3f585fd25e9cb32700a26d54f8ee4" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> axis </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the normalized axis direction of the rotation represented by the Quaternion.</p>
<p>It is null for an identity Quaternion. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a46b7892fe36e140862b9c71e5cfe8292">getAxisAngle()</a>. </p>

</div>
</div>
<a class="anchor" id="a48e0e2dd26cd96418c8b889ceabe80f6"></a><!-- doxytag: member="qglviewer::Quaternion::domElement" ref="a48e0e2dd26cd96418c8b889ceabe80f6" args="(const QString &amp;name, QDomDocument &amp;document) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QDomElement domElement </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QDomDocument &amp;&nbsp;</td>
          <td class="paramname"> <em>document</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an XML <code>QDomElement</code> that represents the Quaternion.</p>
<p><code>name</code> is the name of the QDomElement tag. <code>doc</code> is the <code>QDomDocument</code> factory used to create QDomElement.</p>
<p>When output to a file, the resulting QDomElement will look like: </p>
<div class="fragment"><pre class="fragment"> &lt;name q0=<span class="stringliteral">&quot;..&quot;</span> q1=<span class="stringliteral">&quot;..&quot;</span> q2=<span class="stringliteral">&quot;..&quot;</span> q3=<span class="stringliteral">&quot;..&quot;</span> /&gt;
</pre></div><p>Use <a class="el" href="classqglviewer_1_1Quaternion.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement()</a> to restore the Quaternion state from the resulting <code>QDomElement</code>. See also the <a class="el" href="classqglviewer_1_1Quaternion.html#a87faf5efc96c9b5af85a611985b6618f">Quaternion(const QDomElement&amp;)</a> constructor.</p>
<p>See the <a class="el" href="classqglviewer_1_1Vec.html#a48e0e2dd26cd96418c8b889ceabe80f6">Vec::domElement()</a> documentation for a complete QDomDocument creation and saving example.</p>
<p>See also <a class="el" href="classqglviewer_1_1Frame.html#a48e0e2dd26cd96418c8b889ceabe80f6">Frame::domElement()</a>, <a class="el" href="classqglviewer_1_1Camera.html#a48e0e2dd26cd96418c8b889ceabe80f6">Camera::domElement()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a48e0e2dd26cd96418c8b889ceabe80f6">KeyFrameInterpolator::domElement()</a>... </p>

</div>
</div>
<a class="anchor" id="a80d06247e39abf2980e56d2fe8c4bb83"></a><!-- doxytag: member="qglviewer::Quaternion::dot" ref="a80d06247e39abf2980e56d2fe8c4bb83" args="(const Quaternion &amp;a, const Quaternion &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static double dot </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>b</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the "dot" product of <code>a</code> and <code>b:</code> a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3]. </p>

</div>
</div>
<a class="anchor" id="a5c546a33cc0c65f24b7e9c48e5069ba7"></a><!-- doxytag: member="qglviewer::Quaternion::exp" ref="a5c546a33cc0c65f24b7e9c48e5069ba7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion exp </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the exponential of the Quaternion. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a4db67fbb8171a5e781b56404112cf848">log()</a>. </p>

</div>
</div>
<a class="anchor" id="a46b7892fe36e140862b9c71e5cfe8292"></a><!-- doxytag: member="qglviewer::Quaternion::getAxisAngle" ref="a46b7892fe36e140862b9c71e5cfe8292" args="(Vec &amp;axis, float &amp;angle) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getAxisAngle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>axis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&nbsp;</td>
          <td class="paramname"> <em>angle</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the axis vector and the angle (in radians) of the rotation represented by the Quaternion. See the <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a> documentations. </p>

</div>
</div>
<a class="anchor" id="a315cf039df621a101a953df20acc7155"></a><!-- doxytag: member="qglviewer::Quaternion::getInverseMatrix" ref="a315cf039df621a101a953df20acc7155" args="(GLdouble m[16]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getInverseMatrix </td>
          <td>(</td>
          <td class="paramtype">GLdouble&nbsp;</td>
          <td class="paramname"> <em>m</em>[16]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Same as <a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix()</a>, but with a <code>GLdouble</code>[16] parameter. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a>. </p>

</div>
</div>
<a class="anchor" id="aee97ea226e31ac805a2245e7c73dac7b"></a><!-- doxytag: member="qglviewer::Quaternion::getInverseMatrix" ref="aee97ea226e31ac805a2245e7c73dac7b" args="(GLdouble m[4][4]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getInverseMatrix </td>
          <td>(</td>
          <td class="paramtype">GLdouble&nbsp;</td>
          <td class="paramname"> <em>m</em>[4][4]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Fills <code>m</code> with the OpenGL matrix corresponding to the <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a> rotation.</p>
<p>Use <a class="el" href="classqglviewer_1_1Quaternion.html#a32992f152b7377da431c69f15384ed22">inverseMatrix()</a> if you do not need to store this matrix and simply want to alter the current OpenGL matrix. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a>. </p>

</div>
</div>
<a class="anchor" id="ae1455acb1cbf59befe65295734d48c4a"></a><!-- doxytag: member="qglviewer::Quaternion::getInverseRotationMatrix" ref="ae1455acb1cbf59befe65295734d48c4a" args="(float m[3][3]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getInverseRotationMatrix </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>m</em>[3][3]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><code>m</code> is set to the 3x3 <em>inverse</em> rotation matrix associated with the Quaternion.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>This is the classical mathematical rotation matrix. The OpenGL format uses its transposed version. See <a class="el" href="classqglviewer_1_1Quaternion.html#a32992f152b7377da431c69f15384ed22">inverseMatrix()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a15f0dc7596dc78437154302466ac3c0a"></a><!-- doxytag: member="qglviewer::Quaternion::getMatrix" ref="a15f0dc7596dc78437154302466ac3c0a" args="(GLdouble m[16]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getMatrix </td>
          <td>(</td>
          <td class="paramtype">GLdouble&nbsp;</td>
          <td class="paramname"> <em>m</em>[16]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Same as <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a>, but with a <code>GLdouble</code>[16] parameter. See also <a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix()</a> and <a class="el" href="classqglviewer_1_1Frame.html#a4915640a54a6b48a99cbdd0cd42fec48">Frame::getMatrix()</a>. </p>

</div>
</div>
<a class="anchor" id="a4915640a54a6b48a99cbdd0cd42fec48"></a><!-- doxytag: member="qglviewer::Quaternion::getMatrix" ref="a4915640a54a6b48a99cbdd0cd42fec48" args="(GLdouble m[4][4]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getMatrix </td>
          <td>(</td>
          <td class="paramtype">GLdouble&nbsp;</td>
          <td class="paramname"> <em>m</em>[4][4]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Fills <code>m</code> with the OpenGL representation of the Quaternion rotation.</p>
<p>Use <a class="el" href="classqglviewer_1_1Quaternion.html#aa12123cf45f68b9f7fe0526b70ab0047">matrix()</a> if you do not need to store this matrix and simply want to alter the current OpenGL matrix. See also <a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix()</a> and <a class="el" href="classqglviewer_1_1Frame.html#a4915640a54a6b48a99cbdd0cd42fec48">Frame::getMatrix()</a>. </p>

</div>
</div>
<a class="anchor" id="aad37aa66da74be6fb8d9d66f059f0872"></a><!-- doxytag: member="qglviewer::Quaternion::getRotationMatrix" ref="aad37aa66da74be6fb8d9d66f059f0872" args="(float m[3][3]) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void getRotationMatrix </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>m</em>[3][3]</td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Fills <code>m</code> with the 3x3 rotation matrix associated with the Quaternion.</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#ae1455acb1cbf59befe65295734d48c4a">getInverseRotationMatrix()</a>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd><code>m</code> uses the European mathematical representation of the rotation matrix. Use <a class="el" href="classqglviewer_1_1Quaternion.html#aa12123cf45f68b9f7fe0526b70ab0047">matrix()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a> to retrieve the OpenGL transposed version. </dd></dl>

</div>
</div>
<a class="anchor" id="acd13d2ddeca530cb9f26ead47f7d25d3"></a><!-- doxytag: member="qglviewer::Quaternion::initFromDOMElement" ref="acd13d2ddeca530cb9f26ead47f7d25d3" args="(const QDomElement &amp;element)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initFromDOMElement </td>
          <td>(</td>
          <td class="paramtype">const QDomElement &amp;&nbsp;</td>
          <td class="paramname"> <em>element</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Restores the Quaternion state from a <code>QDomElement</code> created by <a class="el" href="classqglviewer_1_1Quaternion.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a>.</p>
<p>The <code>QDomElement</code> should contain the <code>q0</code>, <code>q1</code> , <code>q2</code> and <code>q3</code> attributes. If one of these attributes is missing or is not a number, a warning is displayed and these fields are respectively set to 0.0, 0.0, 0.0 and 1.0 (identity Quaternion).</p>
<p>See also the <a class="el" href="classqglviewer_1_1Quaternion.html#a87faf5efc96c9b5af85a611985b6618f">Quaternion(const QDomElement&amp;)</a> constructor. </p>

</div>
</div>
<a class="anchor" id="ac378ebc684d691dc25336b895f24a82e"></a><!-- doxytag: member="qglviewer::Quaternion::inverse" ref="ac378ebc684d691dc25336b895f24a82e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion inverse </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the inverse Quaternion (inverse rotation).</p>
<p>Result has a negated <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a> direction and the same <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a>. A composition (see <a class="el" href="classqglviewer_1_1Quaternion.html#a76b3ffdb188246ff6559069cb3f5b919">operator*()</a>) of a Quaternion and its <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a> results in an identity function.</p>
<p>Use <a class="el" href="classqglviewer_1_1Quaternion.html#a7fa1616cc61c19a5efcc863c950f7f30">invert()</a> to actually modify the Quaternion. </p>

</div>
</div>
<a class="anchor" id="a32992f152b7377da431c69f15384ed22"></a><!-- doxytag: member="qglviewer::Quaternion::inverseMatrix" ref="a32992f152b7377da431c69f15384ed22" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const GLdouble * inverseMatrix </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the associated 4x4 OpenGL <em>inverse</em> rotation matrix. This is simply the <a class="el" href="classqglviewer_1_1Quaternion.html#aa12123cf45f68b9f7fe0526b70ab0047">matrix()</a> of the <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The result is only valid until the next call to <a class="el" href="classqglviewer_1_1Quaternion.html#a32992f152b7377da431c69f15384ed22">inverseMatrix()</a>. Use it immediately (as in <code>glMultMatrixd</code>(q.inverseMatrix())) or use <a class="el" href="classqglviewer_1_1Quaternion.html#aee97ea226e31ac805a2245e7c73dac7b">getInverseMatrix()</a> instead.</dd>
<dd>
The matrix is given in OpenGL format (row-major order) and is the transpose of the actual mathematical European representation. Consider using <a class="el" href="classqglviewer_1_1Quaternion.html#ae1455acb1cbf59befe65295734d48c4a">getInverseRotationMatrix()</a> instead. </dd></dl>

</div>
</div>
<a class="anchor" id="a74d79bc1afcc02fdbfe0eb390c3546f5"></a><!-- doxytag: member="qglviewer::Quaternion::inverseRotate" ref="a74d79bc1afcc02fdbfe0eb390c3546f5" args="(const Vec &amp;v) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> inverseRotate </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>v</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the image of <code>v</code> by the Quaternion <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a> rotation.</p>
<p><a class="el" href="classqglviewer_1_1Quaternion.html#a5e2421069d88e576334e10f634625815">rotate()</a> performs an inverse transformation. Same as <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a>.rotate(v). </p>

</div>
</div>
<a class="anchor" id="a7fa1616cc61c19a5efcc863c950f7f30"></a><!-- doxytag: member="qglviewer::Quaternion::invert" ref="a7fa1616cc61c19a5efcc863c950f7f30" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void invert </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Inverses the Quaternion (same rotation <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a>, but negated <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a>).</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a>. </p>

</div>
</div>
<a class="anchor" id="af4c74176967acca6e3947977351e1c68"></a><!-- doxytag: member="qglviewer::Quaternion::lnDif" ref="af4c74176967acca6e3947977351e1c68" args="(const Quaternion &amp;a, const Quaternion &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion lnDif </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>b</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns log(a. <a class="el" href="classqglviewer_1_1Quaternion.html#ac378ebc684d691dc25336b895f24a82e">inverse()</a> * b). Useful for <a class="el" href="classqglviewer_1_1Quaternion.html#a2a27d43a68da6c7c5243fe81e5a9d005">squadTangent()</a>. </p>

</div>
</div>
<a class="anchor" id="a4db67fbb8171a5e781b56404112cf848"></a><!-- doxytag: member="qglviewer::Quaternion::log" ref="a4db67fbb8171a5e781b56404112cf848" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion log </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the logarithm of the Quaternion. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a5c546a33cc0c65f24b7e9c48e5069ba7">exp()</a>. </p>

</div>
</div>
<a class="anchor" id="aa12123cf45f68b9f7fe0526b70ab0047"></a><!-- doxytag: member="qglviewer::Quaternion::matrix" ref="aa12123cf45f68b9f7fe0526b70ab0047" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const GLdouble * matrix </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the Quaternion associated 4x4 OpenGL rotation matrix.</p>
<p>Use <code>glMultMatrixd</code>(q.matrix()) to apply the rotation represented by Quaternion <code>q</code> to the current OpenGL matrix.</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a>, <a class="el" href="classqglviewer_1_1Quaternion.html#aad37aa66da74be6fb8d9d66f059f0872">getRotationMatrix()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a32992f152b7377da431c69f15384ed22">inverseMatrix()</a>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The result is only valid until the next call to <a class="el" href="classqglviewer_1_1Quaternion.html#aa12123cf45f68b9f7fe0526b70ab0047">matrix()</a>. Use it immediately (as shown above) or consider using <a class="el" href="classqglviewer_1_1Quaternion.html#a4915640a54a6b48a99cbdd0cd42fec48">getMatrix()</a> instead.</dd>
<dd>
The matrix is given in OpenGL format (row-major order) and is the transpose of the actual mathematical European representation. Consider using <a class="el" href="classqglviewer_1_1Quaternion.html#aad37aa66da74be6fb8d9d66f059f0872">getRotationMatrix()</a> instead. </dd></dl>

</div>
</div>
<a class="anchor" id="abcdb1512395327f8236a4f4a4d4ff648"></a><!-- doxytag: member="qglviewer::Quaternion::negate" ref="abcdb1512395327f8236a4f4a4d4ff648" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void negate </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Negates all the coefficients of the Quaternion.</p>
<p>This results in an other representation of the <em>same</em> rotation (opposite rotation angle, but with a negated axis direction: the two cancel out). However, note that the results of <a class="el" href="classqglviewer_1_1Quaternion.html#a63f3f585fd25e9cb32700a26d54f8ee4">axis()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a> are unchanged after a call to this method since <a class="el" href="classqglviewer_1_1Quaternion.html#a39bde10d142ce0cbc9614988ca0a0e59">angle()</a> always returns a value in [0,pi].</p>
<p>This method is mainly useful for Quaternion interpolation, so that the spherical interpolation takes the shortest path on the unit sphere. See <a class="el" href="classqglviewer_1_1Quaternion.html#a755201c9a752fd892a3656a517b190e4">slerp()</a> for details. </p>

</div>
</div>
<a class="anchor" id="a05826e509c686f39baaec4656f1a7231"></a><!-- doxytag: member="qglviewer::Quaternion::normalize" ref="a05826e509c686f39baaec4656f1a7231" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double normalize </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Normalizes the Quaternion coefficients.</p>
<p>This method should not need to be called since we only deal with unit Quaternions. This is however useful to prevent numerical drifts, especially with small rotational increments. See also <a class="el" href="classqglviewer_1_1Quaternion.html#ae347ecf6e0a78618e8fd1a3b9107df32">normalized()</a>. </p>

</div>
</div>
<a class="anchor" id="ae347ecf6e0a78618e8fd1a3b9107df32"></a><!-- doxytag: member="qglviewer::Quaternion::normalized" ref="ae347ecf6e0a78618e8fd1a3b9107df32" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion normalized </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a normalized version of the Quaternion.</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a05826e509c686f39baaec4656f1a7231">normalize()</a>. </p>

</div>
</div>
<a class="anchor" id="a0caef8e6e702101a45fdc0af3920c49d"></a><!-- doxytag: member="qglviewer::Quaternion::operator*=" ref="a0caef8e6e702101a45fdc0af3920c49d" args="(const Quaternion &amp;q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion&amp; operator*= </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>q</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Quaternion rotation is composed with <code>q</code>.</p>
<p>See <a class="el" href="classqglviewer_1_1Quaternion.html#a76b3ffdb188246ff6559069cb3f5b919">operator*()</a>, since this is equivalent to <code>this</code> = <code>this</code> * <code>q</code>.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>For efficiency reasons, the resulting Quaternion is not normalized. You may <a class="el" href="classqglviewer_1_1Quaternion.html#a05826e509c686f39baaec4656f1a7231">normalize()</a> it after each application in case of numerical drift. </dd></dl>

</div>
</div>
<a class="anchor" id="a16d5f2f021103b05006b0c58fbd48796"></a><!-- doxytag: member="qglviewer::Quaternion::operator&lt;&lt;" ref="a16d5f2f021103b05006b0c58fbd48796" args="(std::ostream &amp;o, const qglviewer::Vec &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::ostream&amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&nbsp;</td>
          <td class="paramname"> <em>o</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">qglviewer::Vec</a> &amp;&nbsp;</td>
          <td class="paramname"></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Output stream operator. Enables debugging code like: </p>
<div class="fragment"><pre class="fragment">                <a class="code" href="classqglviewer_1_1Quaternion.html#a65ed15cc19af958b5933b5c522f10e66">Quaternion</a> rot(...);
                cout &lt;&lt; <span class="stringliteral">&quot;Rotation=&quot;</span> &lt;&lt; rot &lt;&lt; endl;
</pre></div> 
</div>
</div>
<a class="anchor" id="ad20a1310f5fac88d5e00fa055e09fe72"></a><!-- doxytag: member="qglviewer::Quaternion::operator=" ref="ad20a1310f5fac88d5e00fa055e09fe72" args="(const Quaternion &amp;Q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion&amp; operator= </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>Q</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Equal operator. </p>

</div>
</div>
<a class="anchor" id="af1a8c9c4769161714a5a1a2c7fad446b"></a><!-- doxytag: member="qglviewer::Quaternion::operator[]" ref="af1a8c9c4769161714a5a1a2c7fad446b" args="(int i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double&amp; operator[] </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>i</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Bracket operator returning an l-value. <code>i</code> must range in [0..3]. See the <a class="el" href="classqglviewer_1_1Quaternion.html#a81ba24ffd95778f3ca4e51b2b9922f45">Quaternion(double, double, double, double)</a> documentation. </p>

</div>
</div>
<a class="anchor" id="a605b34d1fc87b2ccaf49a45419c2e46f"></a><!-- doxytag: member="qglviewer::Quaternion::operator[]" ref="a605b34d1fc87b2ccaf49a45419c2e46f" args="(int i) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double operator[] </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>i</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Bracket operator, with a constant return value. <code>i</code> must range in [0..3]. See the <a class="el" href="classqglviewer_1_1Quaternion.html#a81ba24ffd95778f3ca4e51b2b9922f45">Quaternion(double, double, double, double)</a> documentation. </p>

</div>
</div>
<a class="anchor" id="a87d5e98d958fdc63100979fcff1d9976"></a><!-- doxytag: member="qglviewer::Quaternion::randomQuaternion" ref="a87d5e98d958fdc63100979fcff1d9976" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion randomQuaternion </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a random unit Quaternion.</p>
<p>You can create a randomly directed unit vector using: </p>
<div class="fragment"><pre class="fragment">Vec randomDir = <a class="code" href="classqglviewer_1_1Quaternion.html#a87d5e98d958fdc63100979fcff1d9976">Quaternion::randomQuaternion</a>() * Vec(1.0, 0.0, 0.0); <span class="comment">// or any other Vec</span>
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>This function uses rand() to create pseudo-random numbers and the random number generator can be initialized using srand(). </dd></dl>

</div>
</div>
<a class="anchor" id="a5e2421069d88e576334e10f634625815"></a><!-- doxytag: member="qglviewer::Quaternion::rotate" ref="a5e2421069d88e576334e10f634625815" args="(const Vec &amp;v) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> rotate </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>v</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the image of <code>v</code> by the Quaternion rotation.</p>
<p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a74d79bc1afcc02fdbfe0eb390c3546f5">inverseRotate()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a19ce6efe5ef2744c8293e8ba1a39b9e4">operator*(const Quaternion&amp;, const Vec&amp;)</a>. </p>

</div>
</div>
<a class="anchor" id="ad6bd25e80a18f6bd38ae5c4e5337b53b"></a><!-- doxytag: member="qglviewer::Quaternion::setAxisAngle" ref="ad6bd25e80a18f6bd38ae5c4e5337b53b" args="(const Vec &amp;axis, double angle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setAxisAngle </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>axis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>angle</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the Quaternion as a rotation of axis <code>axis</code> and angle <code>angle</code> (in radians).</p>
<p><code>axis</code> does not need to be normalized. A null <code>axis</code> will result in an identity Quaternion. </p>

</div>
</div>
<a class="anchor" id="a760617f082c950633b5642d2f60b2dd9"></a><!-- doxytag: member="qglviewer::Quaternion::setFromRotatedBasis" ref="a760617f082c950633b5642d2f60b2dd9" args="(const Vec &amp;X, const Vec &amp;Y, const Vec &amp;Z)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setFromRotatedBasis </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>Z</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the Quaternion from the three rotated vectors of an orthogonal basis.</p>
<p>The three vectors do not have to be normalized but must be orthogonal and direct (X^Y=k*Z, with k&gt;0).</p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1Quaternion.html#a65ed15cc19af958b5933b5c522f10e66">Quaternion</a> q;
  q.setFromRotatedBasis(X, Y, Z);
  <span class="comment">// Now q.rotate(Vec(1,0,0)) == X and q.inverseRotate(X) == Vec(1,0,0)</span>
  <span class="comment">// Same goes for Y and Z with Vec(0,1,0) and Vec(0,0,1).</span>
</pre></div><p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a1880f20e8080ee670b6a88ed0c7d69ac">setFromRotationMatrix()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a1b60be34a715145efc3b91e6dfba1634">Quaternion(const Vec&amp;, const Vec&amp;)</a>. </p>

</div>
</div>
<a class="anchor" id="a1880f20e8080ee670b6a88ed0c7d69ac"></a><!-- doxytag: member="qglviewer::Quaternion::setFromRotationMatrix" ref="a1880f20e8080ee670b6a88ed0c7d69ac" args="(const double m[3][3])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setFromRotationMatrix </td>
          <td>(</td>
          <td class="paramtype">const double&nbsp;</td>
          <td class="paramname"> <em>m</em>[3][3]</td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the Quaternion from a (supposedly correct) 3x3 rotation matrix.</p>
<p>The matrix is expressed in European format: its three <em>columns</em> are the images by the rotation of the three vectors of an orthogonal basis. Note that OpenGL uses a symmetric representation for its matrices.</p>
<p><a class="el" href="classqglviewer_1_1Quaternion.html#a760617f082c950633b5642d2f60b2dd9">setFromRotatedBasis()</a> sets a Quaternion from the three axis of a rotated frame. It actually fills the three columns of a matrix with these rotated basis vectors and calls this method. </p>

</div>
</div>
<a class="anchor" id="abe7dd94e4fb48e0c8e0d994cac84064a"></a><!-- doxytag: member="qglviewer::Quaternion::setValue" ref="abe7dd94e4fb48e0c8e0d994cac84064a" args="(double q0, double q1, double q2, double q3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setValue </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>q3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the Quaternion value. See the <a class="el" href="classqglviewer_1_1Quaternion.html#a81ba24ffd95778f3ca4e51b2b9922f45">Quaternion(double, double, double, double)</a> constructor documentation. </p>

</div>
</div>
<a class="anchor" id="a755201c9a752fd892a3656a517b190e4"></a><!-- doxytag: member="qglviewer::Quaternion::slerp" ref="a755201c9a752fd892a3656a517b190e4" args="(const Quaternion &amp;a, const Quaternion &amp;b, float t, bool allowFlip=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion slerp </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>allowFlip</em> = <code>true</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the slerp interpolation of Quaternions <code>a</code> and <code>b</code>, at time <code>t</code>.</p>
<p><code>t</code> should range in [0,1]. Result is <code>a</code> when <code>t=0</code> and <code>b</code> when <code>t=1</code>.</p>
<p>When <code>allowFlip</code> is <code>true</code> (default) the slerp interpolation will always use the "shortest path" between the Quaternions' orientations, by "flipping" the source Quaternion if needed (see <a class="el" href="classqglviewer_1_1Quaternion.html#abcdb1512395327f8236a4f4a4d4ff648">negate()</a>). </p>

</div>
</div>
<a class="anchor" id="a4b218b205d88a4dd50c8de38522b5812"></a><!-- doxytag: member="qglviewer::Quaternion::squad" ref="a4b218b205d88a4dd50c8de38522b5812" args="(const Quaternion &amp;a, const Quaternion &amp;tgA, const Quaternion &amp;tgB, const Quaternion &amp;b, float t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion squad </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>tgA</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>tgB</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>t</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the slerp interpolation of the two Quaternions <code>a</code> and <code>b</code>, at time <code>t</code>, using tangents <code>tgA</code> and <code>tgB</code>.</p>
<p>The resulting Quaternion is "between" <code>a</code> and <code>b</code> (result is <code>a</code> when <code>t=0</code> and <code>b</code> for <code>t=1</code>).</p>
<p>Use <a class="el" href="classqglviewer_1_1Quaternion.html#a2a27d43a68da6c7c5243fe81e5a9d005">squadTangent()</a> to define the Quaternion tangents <code>tgA</code> and <code>tgB</code>. </p>

</div>
</div>
<a class="anchor" id="a2a27d43a68da6c7c5243fe81e5a9d005"></a><!-- doxytag: member="qglviewer::Quaternion::squadTangent" ref="a2a27d43a68da6c7c5243fe81e5a9d005" args="(const Quaternion &amp;before, const Quaternion &amp;center, const Quaternion &amp;after)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion squadTangent </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>before</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>center</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>after</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a tangent Quaternion for <code>center</code>, defined by <code>before</code> and <code>after</code> Quaternions.</p>
<p>Useful for smooth spline interpolation of Quaternion with <a class="el" href="classqglviewer_1_1Quaternion.html#a4b218b205d88a4dd50c8de38522b5812">squad()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a755201c9a752fd892a3656a517b190e4">slerp()</a>. </p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a19ce6efe5ef2744c8293e8ba1a39b9e4"></a><!-- doxytag: member="qglviewer::Quaternion::operator*" ref="a19ce6efe5ef2744c8293e8ba1a39b9e4" args="(const Quaternion &amp;q, const Vec &amp;v)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> operator* </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>v</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the image of <code>v</code> by the rotation <code>q</code>.</p>
<p>Same as q.rotate(v). See <a class="el" href="classqglviewer_1_1Quaternion.html#a5e2421069d88e576334e10f634625815">rotate()</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a74d79bc1afcc02fdbfe0eb390c3546f5">inverseRotate()</a>. </p>

</div>
</div>
<a class="anchor" id="a76b3ffdb188246ff6559069cb3f5b919"></a><!-- doxytag: member="qglviewer::Quaternion::operator*" ref="a76b3ffdb188246ff6559069cb3f5b919" args="(const Quaternion &amp;a, const Quaternion &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quaternion operator* </td>
          <td>(</td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Quaternion &amp;&nbsp;</td>
          <td class="paramname"> <em>b</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the composition of the <code>a</code> and <code>b</code> rotations.</p>
<p>The order is important. When applied to a <a class="el" href="classqglviewer_1_1Vec.html" title="The Vec class represents 3D positions and 3D vectors.">Vec</a> <code>v</code> (see <a class="el" href="classqglviewer_1_1Quaternion.html#a19ce6efe5ef2744c8293e8ba1a39b9e4">operator*(const Quaternion&amp;, const Vec&amp;)</a> and <a class="el" href="classqglviewer_1_1Quaternion.html#a5e2421069d88e576334e10f634625815">rotate()</a>) the resulting Quaternion acts as if <code>b</code> was applied first and then <code>a</code> was applied. This is obvious since the image <code>v'</code> of <code>v</code> by the composited rotation satisfies: </p>
<div class="fragment"><pre class="fragment">                v<span class="stringliteral">&#39;= (a*b) * v = a * (b*v) </span>
</pre></div><p>Note that a*b usually differs from b*a.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>For efficiency reasons, the resulting Quaternion is not normalized. Use <a class="el" href="classqglviewer_1_1Quaternion.html#a05826e509c686f39baaec4656f1a7231">normalize()</a> in case of numerical drift with small rotation composition. </dd></dl>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"/><address style="text-align: right;"><small>libQGLViewer 2.3.6 documentation generated by
<a href="http://www.doxygen.org/index.html">
doxygen</a> 1.6.2 </small></address>
</body>
</html>