Skip to content

Commit

Permalink
Detailed explanation of quat. product
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFabisch committed Oct 6, 2024
1 parent fa709e2 commit 74c7a2a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pytransform3d/rotations/_quaternion_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,26 @@ def quaternion_gradient(Q, dt=1.0):


def concatenate_quaternions(q1, q2):
"""Concatenate two quaternions.
r"""Concatenate two quaternions.
We concatenate two quaternions by quaternion multiplication
:math:`\boldsymbol{q}_1\boldsymbol{q}_2`.
We use Hamilton's quaternion multiplication.
Suppose we want to apply two extrinsic rotations given by quaternions
q1 and q2 to a vector v. We can either apply q2 to v and then q1 to
the result or we can concatenate q1 and q2 and apply the result to v.
If the two quaternions are divided up into scalar part and vector part
each, i.e.,
:math:`\boldsymbol{q} = (w, \boldsymbol{v}), w \in \mathbb{R},
\boldsymbol{v} \in \mathbb{R}^3`, then the quaternion product is
.. math::
\boldsymbol{q}_{12} =
(w_1 w_2 - \boldsymbol{v}_1 \cdot \boldsymbol{v}_2,
w_1 \boldsymbol{v}_2 + w_2 \boldsymbol{v}_1
+ \boldsymbol{v}_1 \times \boldsymbol{v}_2)
with the scalar product :math:`\cdot` and the cross product :math:`\times`.
Parameters
----------
Expand Down

0 comments on commit 74c7a2a

Please sign in to comment.