[math-fun] Quaternions & vectors, yet again
Given vectors A,A',B,B', such that qAq*=A' and qBq*=B', |A'|=|A|, |B'|=|B|, find q. (q* is conjugate of q.) Taking norms, we find that qq*=1. Let dA=A'-A and dB=B'-B. Then the axis of rotation is dAxdB. This means that the vector part of q is perpendicular to both dA and dB. We will split A,B,A',B' into parts that are parallel to the rotation axis and parts that are perpendicular to the axis: A = Apar + Aper B = Bpar + Bper A' = Apar + (Aper + dA) B' = Bpar + (Bper + dB) qAq* = q(Apar + Aper)q* = q(Apar)q* + q(Aper)q* = qq* Apar + q^2 Aper (Lemma from previous post) = Apar + q^2 Aper = Apar + (Aper+dA) So, q^2 Aper = Aper+dA, or q^2 = (Aper+dA)/Aper = 1+dA/Aper. ("/" here means quaternion division.) Similarly, q^2 = 1+dB/Bper. Checking, we find that the vector part of q is parallel to the vector part of q^2. Furthermore, the vector part of dA/Aper is a multiple of dAxAper which is the same axis as dB/Bper which is a multiple of dBxBper. These are all parallel to dAxdB. We note that even when |A|=|A'|/=|B|=|B'|, |dA/Aper|=|dB/Bper|, so dA/Aper=dB/Bper in both magnitude and direction. So we now need to compute Aper, Bper. If S=dAxdB, then Aper = SxAxS/(S.S) Bper = SxBxS/(S.S) (Note that "x" associates in this particular instance.) Thus, S=dAxdB and q = +- sqrt(1+(S.S)dA/SxAxS) = +- sqrt(1+(S.S)dB/SxBxS) is the quaternion we seek. (It would still be interesting to find an expression for this quaternion that didn't involve dot or cross products; i.e., only the rational operations +,-,*,/ and sqrt.)
participants (1)
-
Henry Baker