anchor.diff:  == Part 2. Application
   
   In Part 2 we will be talking about using quaternion to solve real problems in programming. I will be using general vector form stem:[q=(\vec{v},w)] even for unit quaternion instead of stem:[q=(sin⁡\frac{θ}{2}\vec{v},cos⁡\frac{θ}{2})], since it is closed to the actual data format.
  -Recall the definition of general quaternion multiplication we mentioned in Part 1. Let stem:[q_a=(\vec{a},0)], stem:[q_b=(\vec{b},0)] then
  -
  -[stem]
  -++++
  -{q_a}{q_b}=(\vec{a},0)(\vec{b},0)=(\vec{a}×\vec{b},-\vec{a}·\vec{b})
  +
  +Recall the definition of general quaternion multiplication we mentioned in Part 1. Let stem:[q_1=(\vec{v_1},w_1)], stem:[q_2=(\vec{v_2},w_2)] then
  +
  +[stem]
  +++++
  +{q_1}{q_2}=(\vec{v_1},w_1)(\vec{v_2},w_2)=(w_1\vec{v_2} + w_2\vec{v_1} + \vec{v_1}×\vec{v_2}, {w_1}{w_2}-\vec{v_1}·\vec{v_2})
   ++++
   
   We will be using this a lot in the following sections.
  +
   The coordinate system we use is Z up and right-handed.
   
   === Calculation of Vector Rotation
  
positive.code: &=\vec{p}+2(\vec{v}×(\vec{v}×\vec{p}+w\vec{p}))
  \end{align*}
  ++++  
  
  === Appendix: Derive Quaternion Multiplication
  
  
negative.code: [stem]
  ++++
  \begin{align*}
  \vec{v}×(\vec{v}×\vec{p})&=(\vec{v}·\vec{p})\vec{v}+w^{2}\vec{p}-\vec{p}\\
  (\vec{v}·\vec{p})\vec{v}+w^{2}\vec{p}&=\vec{v}×(\vec{v}×\vec{p})+\vec{p}\\
  \end{align*}
  ++++  
  
  