We can take our matrix product below, which is an orthogonal matrix. Let's call it M. Then we can easily recover the quaternion from the orthogonal matrix M using the inverse _Cayley Transform_: S = (I-M)(I+M)^-1 The matrix I+M is invertible, because we have _rigid_ rotations (i.e., no reflections, hence no eigenvalues of -1). S is a _skew-symmetric_ matrix: [ 0 z -y] [-z 0 x] [ y -x 0] = S Then our (non-normalized) quaternion is [1,x,y,z]. http://en.wikipedia.org/wiki/Cayley_transform At 02:06 PM 6/7/2014, Henry Baker wrote:
We can easily do it with vectors & matrices:
We are given A,B,A',B', where |A|=|B|=|A'|=|B'|. R(A)=A', R(B)=B'.
Because the rotation R is rigid, we know that
R(AxB) = A'xB' = R(A)xR(B)
Assuming that B is not a multiple of A, we can form the 3x3 matrices R=matrix(A,B,AxB) and R'=matrix(A',B',A'xB').
Our answer is then the matrix product
R^-1 R' =
matrix(A,B,AxB)^-1 matrix(A',B',A'xB')
You are now free to convert this _orthogonal_ matrix into a quaternion at your leisure.
(Although AxB, A'xB' are not unit vectors, hence R,R' are not orthogonal matrices, nevertheless, R^-1 R' _is_ orthogonal.)
(Contrary to Knuth, I did actually try this on some numbers & it worked!)
At 04:25 AM 6/7/2014, Dan Asimov wrote:
In almost all cases, V := (A-A')x(B-B') will be a vector in the direction of the axis of rotation. Knowing V makes it easy to project say A and A' onto the perpendicular plane to C to determine the angle T.
The remaining cases should be easy to exclude or deal with.
--Dan
On Jun 7, 2014, at 1:32 AM, Robert Smith <quad@symbo1ics.com> wrote:
Let A and B be unit vectors in R^3. Suppose they are rotated about some vector V by an angle T, resulting in A' and B' respectively. What are V and T?
I set up a quadratic system using quaternions and got a result that was 3 million terms large. Am I missing something?