title: Incremental application of Quaternion
body: <p>I'm trying to figure out how I might apply a rotation in multiple increments,
  to an orientation which is dynamic (i.e. <em>I cannot use slerp</em>).</p>
  
  <p><strong>Details:</strong>
  I have an object in a 3D space, whose orientation can be described by quaternion <code>Q</code>.
  While this object is rotating, it receives periodic updates from another server,
  which defines the true orientation.  For example, at time <code>t1</code>, the object's orientation
  was <code>Q1</code>, and received an update that the correct orientation should be <code>K1</code>.</p>
  
  <p>I cannot simply replace <code>Q1</code> by <code>K1</code> because the visual result will not be smooth,
  so I would rather correct gradually from <code>Q1</code> to <code>K1</code> over a sequence of 10 steps.
  Also, I cannot use slerp, because <code>Q1</code> is not static.  Rather, I would like
  to derive an incremental correction, which I call <code>dK</code>, until the next server update
  arrives.</p>
  
  <p>Right now I derive <code>dK</code> in the following way:</p>
  
  <ol>
  <li><code>delK = K1 * Q1.conjugate()</code></li>
  <li><code>dk = delK / 10</code></li>
  </ol>
  
  <p>What actually happens at step 2, is that I convert <code>delK</code> to an axis+angle representaion,
  and then divide the angle by 10.  Then I convert back to a quaternion.</p>
  
  <p><strong>Question 1:</strong> Is the approach described above mathematically correct?</p>
  
  <p><strong>Question 2:</strong> I am seeing cases where <code>dk</code> is not a small correction and possibly rotating in the opposite direction.  What might cause this.</p>
  
  <p>This is for the implementation of client-side prediction in JavaScript <a href="http://incheon.gg" rel="nofollow noreferrer">incheon</a>.</p>