Quaternion Rotation and Its Inverse
1 Quaternion and Axis–Angle Representation
Let a unit quaternion be
q=wxyz=w+xi+yj+zk,w2+x2+y2+z2=1.
Let the vector part be
v=xyz.
A rotation by angle θ about the unit vector u^ can be represented by
q=[cos(θ/2)u^sin(θ/2)].
That is,
q=(cos2θ,u^sin2θ).
2 Quaternion to Rotation Matrix
The rotation matrix corresponding to
q=(w,x,y,z)
is
R(q)=1−2(y2+z2)2(xy+zw)2(xz−yw)2(xy−zw)1−2(x2+z2)2(yz+xw)2(xz+yw)2(yz−xw)1−2(x2+y2).
Using the vector v, this can also be written as
R(q)=(w2−vTv)I+2vvT+2w[v]×,
where
[v]×=0z−y−z0xy−x0.
3 Inverse of the Rotation Matrix
A rotation matrix is orthogonal, so
R−1=RT.
Therefore,
R(q)−1=R(q)T.
Taking the transpose gives
R(q)−1=1−2(y2+z2)2(xy−zw)2(xz+yw)2(xy+zw)1−2(x2+z2)2(yz−xw)2(xz−yw)2(yz+xw)1−2(x2+y2).
4 Quaternion Inverse
For a general quaternion,
q−1=∥q∥2q∗,
where the quaternion conjugate is
q∗=w−xi−yj−zk.
Therefore,
q−1=w2+x2+y2+z21w−x−y−z.
For a unit quaternion,
w2+x2+y2+z2=1,
so this simplifies to
q−1=q∗=w−x−y−z.
Consequently,
R(q)−1=R(q−1)=R(q∗).
In other words, to invert a unit-quaternion rotation, simply negate the vector part:
(w,x,y,z)−1=(w,−x,−y,−z).
5 Inverse Rotation: Reverse Axis or Negative Angle?
Suppose the original rotation is
q(u^,θ)=(cos2θ,u^sin2θ).
Its inverse is
q−1=(cos2θ,−u^sin2θ).
There are two equivalent ways to interpret this inverse rotation.
5.1 Reverse the axis
Keep the angle positive:
q−1=(cos2θ,(−u^)sin2θ).
Thus,
q−1=q(−u^,θ).
This means: rotate by +θ about the opposite axis.
5.2 Use a negative angle
Keep the axis unchanged:
q(u^,−θ)=(cos2−θ,u^sin2−θ).
Since
cos(−x)=cosx,sin(−x)=−sinx,
we obtain
q(u^,−θ)=(cos2θ,−u^sin2θ).
Therefore,
q(u^,−θ)=q(−u^,θ).
The corresponding rotation matrices are also identical:
R(u^,−θ)=R(−u^,θ)=R(u^,θ)−1.
6 Concrete Example
Consider a 90∘ rotation around the positive Z axis:
u^=001,θ=90∘.
The rotation matrix is
Rz(90∘)=010−100001.
Its inverse is
Rz(90∘)−1=Rz(−90∘)=0−10100001.
This can be interpreted either as
rotate −90∘ around +Z
or
rotate +90∘ around −Z.
Both descriptions produce exactly the same rotation.
7 Key Result
For a unit quaternion,
q=(cos2θ,u^sin2θ)
and
q−1=(cos2θ,−u^sin2θ).
Thus,
R(q)−1=R(q)T=R(q−1)
and the inverse rotation can be understood equivalently as
(u^,θ)⟶(u^,−θ)
or
(u^,θ)⟶(−u^,θ).
The two axis–angle descriptions represent the same physical rotation.