0

We know that rotate and quaternion multiply are not commutative:

$$q_1q_2 \neq q_2q_1$$

$\exp$ and $\log$ transform between unit quaternion and rotation vector , but if we do this:

$$\log(q_1q_2) = \log(q_1)+\log(q_2)=\log(q_2q_1)$$

$$q_1q_2 = e^{\log(q_1q_2)} = e^{\log(q_2q_1)} = q_2q_1$$

what wrong with my equation?

lioness99a
  • 4,943
  • How is $\log$ defined on quaternions? – 5xum Mar 13 '17 at 12:34
  • Concerning the logarithm see this thread and concerning the exponential (non-commutativity) see this one (you may revert $,e^{a+\rho I}=e^{,a}e^{,\rho I}=x+Iy,$. to deduce the quaternionic $,\log(x+Iy)$ for $;I:=\dfrac{bi+cj+dk}{\rho}$ with $;\rho:=\sqrt{b^2+c^2+d^2};$ if $,q=a+bi+cj+dk$) – Raymond Manzoni Mar 13 '17 at 13:08

2 Answers2

1

Just because quaternion does not commute, for two quaternion (unit or not it's not important) $q_1,q_2$ we have, in general: $$ e^{q_1}e^{q_2}\ne e^{q_2}e^{q_1} \ne e^{q_1+q_2} $$

and this means that, also if we define e "principal value" for the logarithm of quaternions, in general we cannot have $\log (q_1 q_2)=\log q_1 + \log q_2$.

In other words: exponential and logarithm of quaternions have not the usual properties because quaternions are not a field.

Emilio Novati
  • 62,675
0

What's wrong in your equation is your implementation of the log function. Edit: Let me rephrase that... log(QxP) != Log(Q)+Log(P) becasuse the QxP is already a 'truncated' operation, that only reflects 1/2 of the rotation (from +1 to -1 in one direction); the seperate operation is equivalent, if you exp( Log(Q)+Log(P) ) it will truncate to QXP....

I started this project to explore log quaternions. From initial research, I gathered that just because Q != ln(exp(Q)) doesn't mean that for every lnQ, exp(lnQ) = Q. That is that log quaternions are a field, of which a projection into quaternion space can happen, but there is no way to reverse the transform without additional information about the quaternion.

The system of log-quaternions is truly linear, in a manhattan-normal sense of linear. The sum of the angles is the total rotation of the system; there are many implementations that presume that a normal vector (1) is a square-normal and not a linear normal, which results in a sort of logrithmic output of exp(lnQ).

The log-quaternions may be considered 'curvatures' rather than 'angles', although numerically and functionally equivalent in many cases... the 'curvature' applied to the point (0,1,0) {some arbitrary 'up'} results in that point in a different direction. It doesn't matter if the curvature is a small principal arc-length like pi/4, or some more acute curvature that wraps multiple times before being offset by pi/4... K2pi + pi/4 , the same projection results....

Interactive demo - the slider X/T/Z control the curvature (angles of rotation) around the x-y-z axles (axle because they spin, right?) The Y controls the twist at the point x/y/z rotate (curve?) (0,1,0) to.

J Decker
  • 111
  • 4