11_quaternion
Quaternion
[kwə'tɝnɪən], 四元数, 复数在三维的推广,是一种新定义的数学表达形式。形式为:
q=w+xi+yj+zk
其中i,i,k是-1在三维中的平方根。
四元数表示空间中的点
笛卡尔坐标:[x,y,z].则对应四元数q=xi+yj+zk,又称为纯四元数,即实部为0的四元数。
四元数表示三维旋转
q=(x,y,z,w)=(→v,w)=(→n⋅sinθ2,cosθ2)
q为单位四元数。即若以这样的对应关系,则旋转矩阵的存储与计算会有极大的方便。因此四元数对旋转矩阵的表示可以认为是定义了一种对应关系:
R(q)=[1−2(y2+z2)2(xy−zw)29xz+yw)2(xy+zw)1−2(x2+z2)29yz−xw)2(xz−yw)2(yz+xw)1−2(x2+y2)]
四元数运算
若将四元数视为纯量-向量的形式,则定义四元数加法(adding): q1+q2=(a1+v1)+(a2+v2)=a1+a2+v1+v2 四元数乘法(multiplication): q1q2=(a1+v1)(a2+v2)=a1a2−v1⋅v2+(a1v2+a2v1+v1×v2) 四元数乘法公式可以根据虚数单位的基本共式推导出来,所以上式仅有形式上的意义而不具备几何意义。四元数乘法表示两个旋转矩阵相乘。 q∗=a−v|q|=√a2+||v||2q−1=a−v 仿照单位复数与欧拉公式: eθ2(xi+yj+zk)=cosθ2+(xi+yj+zk)sinθ2,for x,y,z∈R s.t.x2+y2+z2=1 log(q)=θ2(xi+yj+zk) 四元数的旋转变换
设 q 为一个单位四元数,而 p 是一个纯四元数,则: Rq(p)=qpq−1 也是一个纯四元数,代表空间的点p经过旋转变换q之后的四元数表示。故: Rq1q2(p)=q1q2pq−12q−11=Rq1(Rq2(p))
dual quaternion
q=qr+ϵqd, where ϵ2=0 或者通过上三角冒表示对偶四元数: ˆq=q+ϵqϵ
Like the quaternion,the unit dual-quaternin is our key concern as it can represent any rigid rotational and translational transformations. qr=rqd=12tr where r is a unit quaternion representing the rotation and t is the quaternion describing the translation.
Operation
- scalar: aq=aqr+aϵqd
- multiplication: q1+q2=qr1+qr2+ϵ(qd1+qd2)
- conjugate: $q^={q_r}^+\epsilon {q_d}^*$
- unit condition:$||q||=1,\quad {q_r}^q_d+{q_d}^q_r=0$
空间变换
Trans(p)=qpq∗
**the logarithmic **
Kinematic Control of Free Rigid Bodies Using Dual Quaternions
Assume qr=cosϕ2+sinϕ2n,qt=ps, where n and s is vector, p is the scalar of qt. q=qr+ϵqtlog(q)=12ϕn+ϵ12ps||log(q)||=√<log(q),log(q)><log(q),log(q)>=log(q)˙log(1)T=|ϕ|2+2ϵϕcosα4, α is the angle between n and s
define: R(q)=2||log(q)||=|ϕ|+ϵ|pcosα| the difference of two dual quaternion: e12=q1q∗2 the distance of two dual quaternion: D(q1,q2)=R(e12)