|
From: Robert D. <rob...@gm...> - 2014-06-21 03:00:02
|
On 2014-06-20, Henry Baker <hb...@pi...> wrote:
> Quaternion simplification is essentially
> the expanding of quaternion expressions by [...]
Henry, I've taken the liberty of taking this text and pasting it into
a Texinfo document (with minimal formatting) such that it can be
processed by makeinfo and build_index.pl to bring it into the Maxima
help system. I've appended the text below, as it is displayed by ??.
If we commit the quaternion package to share, can I assume that we
can commit this text as well?
best,
Robert Dodier
PS.
(%i1) ?? quater
(%o1) false
(%i2) load ("quaternion-index.lisp");
(%o2) /home/robert/maxima/maxima-code/share/contrib/quaternion-index.lisp
(%i3) ?? quater
1.1 Introduction to quaternion
==============================
Quaternion simplification is essentially the expanding of quaternion
expressions by multiplying and distributing everything out. This
converts quaternion products and vector cross products into linear
combinations of "atomic" vectors such as A, B, AxB, etc., where the
coefficients are scalar expressions involving scalar parts of
quaternions, norms of quaternions, etc.
For example, if A,B,C are vectors (scalar part =0), the quaternion
product of all 3 is
(%i1) A.B.C;
(%o1) - dot(A, B) C - A dot(B, C) + dot(A, C) B - triple(A, B, C)
(%i2)
The pattern changes for A.B.C.D, which uses a linear combination of
A,AxB,AxC,AxD:
(%i16) ABCD:A.B.C.D$
(%i17) S(ABCD);
(%o17) dot(A, B) dot(C, D) - dot(A, C) dot(B, D) + dot(A, D) dot(B, C)
(%i18) ratcoef(ABCD,A);
(%o18) - triple(B, C, D)
(%i19) ratcoef(ABCD,cross(A,B));
(%o19) - dot(C, D)
(%i20) ratcoef(ABCD,cross(A,C));
(%o20) dot(B, D)
(%i21) ratcoef(ABCD,cross(A,D));
(%o21) - dot(B, C)
(%i22)
The final step in quaternion simplification is choosing an
orthogonal basis for representing the expression. Thus, if a
quaternion expression looks like s+a*A+b*B+c*C+d*D..., where A,B,C,D,...
are vectors and s,a,b,c,d are scalar expressions, we know that we can
represent this same expression as s+a'*A'+b'*B'+c'*C', where A',B',C'
are exactly 3 mutually orthogonal vectors, and a',b',c' are scalar
expressions, one or more of which might be zero. We do NOT require
that A',B',C' be unit vectors, so |A'| is not necessarily 1; ditto for
|B'| and |C'|.
One obvious choice of a basis would be the unit quaternions I,J,K:
Q = S(Q)+(Q.I)I+(Q.J)J+(Q.K)K
However, in most calculations, I,J,K will not be the most convenient
or perspicuous basis; it will be better to choose a basis that matches
one or more of the vectors found in the expression itself.
Given vectors A,B, we can quickly construct an orthogonal (but not
orthonormal) basis using the basis vectors A, AxBxA, AxB. (We note
that the expression AxBxA is not ambiguous, because although the vector
cross product "x" is not in general associative,
Ax(BxA)=(AxB)xA=(A.A)B-(A.B)A)
Given 3 mutually orthogonal vectors U,V,W, we can now represent
quaternion Q as
Q = S(Q)+((Q.U)/(U.U))U+((Q.V)/(V.V))V+((Q.W)/(W.W))W
Given any 2 vectors A,B such that AxB/=0, we can represent any Q in
terms of A,AxBxA, AxB.
Our routine express2(A.B.C,A,B) will express the product A.B.C in
terms of the vectors A, B, AxB; it is a bit messy, so we pull it apart
for you:
(%i1) ABC:express2(A.B.C, A, B),expand$
(%i2) S(ABC);
(%o2) - triple(A, B, C)
(%i3) VABC:V(ABC),factor$
(%i4) denom(VABC);
2
(%o4) N(A) N(B) - dot (A, B)
(%i5) NVABC:VABC*%,factor$
(%i6) ratcoef(NVABC,A),expand;
2
(%o6) - N(A) N(B) dot(B, C) + 2 dot (A, B) dot(B, C) - dot(A, B) dot(A, C) N(B)
(%i7) ratcoef(NVABC,B),expand;
(%o7) N(A) dot(A, C) N(B) - N(A) dot(A, B) dot(B, C)
(%i8) ratcoef(NVABC,cross(A,B)),expand;
(%o8) - dot(A, B) triple(A, B, C)
(%o3) true
|