四元数相乘的雅可比矩阵
两个四元数
q
1
,
q
2
q_1, q_2
q1,q2定义如下:
q
1
=
[
w
1
v
1
⃗
]
=
[
w
1
x
1
y
1
z
1
]
q
2
=
[
w
2
v
2
⃗
]
=
[
w
2
x
2
y
2
z
2
]
q_1 = \begin{bmatrix} w_1 \\ \vec{v_1} \end{bmatrix} = \begin{bmatrix} w_1\\x_1\\y_1\\z_1 \end{bmatrix} \\ q_2 = \begin{bmatrix} w_2 \\ \vec{v_2} \end{bmatrix} = \begin{bmatrix} w_2\\x_2\\y_2\\z_2 \end{bmatrix}
q1=[w1v1]=
w1x1y1z1
q2=[w2v2]=
w2x2y2z2
令四元数
q
3
q_3
q3为
q
1
q_1
q1和
q
2
q_2
q2的乘积:
q
3
=
q
1
∘
q
2
q_3 = q_1 \circ q_2
q3=q1∘q2
其中
∘
\circ
∘表示四元数乘法。
本文将给出 q 3 q_3 q3分别对 q 1 q_1 q1和 q 2 q_2 q2的雅可比矩阵,其不严谨地书写为 d q 3 d q 1 \frac{dq_3}{dq_1} dq1dq3和 d q 3 d q 2 \frac{dq_3}{dq_2} dq2dq3.
首先定义两个概念:左叉乘矩阵和右叉乘矩阵。对于两个三维向量
v
1
⃗
=
[
x
1
y
1
z
1
]
T
,
v
2
⃗
=
[
x
2
y
2
z
2
]
T
\vec{v_1} = [x_1~y_1~z_1]^T, \vec{v_2} = [x_2~y_2~z_2]^T
v1=[x1 y1 z1]T,v2=[x2 y2 z2]T,左叉乘矩阵
[
⋅
]
l
∈
R
3
×
3
[\cdot]_l \in R^{3 \times 3}
[⋅]l∈R3×3定义为:
v
1
⃗
×
v
2
⃗
=
[
v
1
⃗
]
l
v
2
⃗
=
[
0
−
z
1
y
1
z
1
0
−
x
1
−
y
1
x
1
0
]
v
2
⃗
\vec{v_1} \times \vec{v_2} = \left[ \vec{v_1} \right]_l \vec{v_2} = \begin{bmatrix} 0 & -z_1 & y_1 \\ z_1 & 0 & -x_1 \\ -y_1 & x_1 & 0 \end{bmatrix} \vec{v_2}
v1×v2=[v1]lv2=
0z1−y1−z10x1y1−x10
v2
右叉乘矩阵
[
⋅
]
r
∈
R
3
×
3
[\cdot]_r \in R^{3 \times 3}
[⋅]r∈R3×3定义为:
v
1
⃗
×
v
2
⃗
=
[
v
2
⃗
]
r
v
1
⃗
=
[
0
z
2
−
y
2
−
z
2
0
x
2
y
2
−
x
2
0
]
v
1
⃗
\vec{v_1} \times \vec{v_2} = \left[ \vec{v_2} \right]_r \vec{v_1} = \begin{bmatrix} 0 & z_2 & -y_2\\ -z_2 & 0 & x_2\\ y_2 & -x_2 & 0 \end{bmatrix} \vec{v_1}
v1×v2=[v2]rv1=
0−z2y2z20−x2−y2x20
v1
Finally,雅可比矩阵如下所示:
d
q
3
d
q
1
=
[
w
2
−
v
2
⃗
v
2
⃗
w
2
I
+
[
v
2
⃗
]
r
]
=
[
w
2
−
x
2
−
y
2
−
z
2
x
2
w
2
z
2
−
y
2
y
2
−
z
2
w
2
x
2
z
2
y
2
−
x
2
w
2
]
d
q
3
d
q
2
=
[
w
1
−
v
1
⃗
v
1
⃗
w
1
I
+
[
v
1
⃗
]
l
]
=
[
w
1
−
x
1
−
y
1
−
z
1
x
1
w
1
−
z
1
y
1
y
1
z
1
w
1
−
x
1
z
1
−
y
1
x
1
w
1
]
\frac{dq_3}{dq_1} = \begin{bmatrix} w_2 & -\vec{v_2} \\ \vec{v_2} & w_2I + \left[ \vec{v_2} \right]_r \end{bmatrix}= \begin{bmatrix} w_2 & -x_2 & -y_2 & -z_2 \\ x_2 & w_2 & z_2 & -y_2\\ y_2 & -z_2 & w_2 & x_2\\ z_2 & y_2 & -x_2 & w_2 \end{bmatrix} \\ \frac{dq_3}{dq_2} = \begin{bmatrix} w_1 & -\vec{v_1} \\ \vec{v_1} & w_1I + \left[ \vec{v_1} \right]_l \end{bmatrix}= \begin{bmatrix} w_1 & -x_1 & -y_1 & -z_1 \\ x_1 & w_1 & -z_1 & y_1 \\ y_1 & z_1 & w_1 & -x_1 \\ z_1 & -y_1 & x_1 & w_1 \end{bmatrix}
dq1dq3=[w2v2−v2w2I+[v2]r]=
w2x2y2z2−x2w2−z2y2−y2z2w2−x2−z2−y2x2w2
dq2dq3=[w1v1−v1w1I+[v1]l]=
w1x1y1z1−x1w1z1−y1−y1−z1w1x1−z1y1−x1w1