MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Quaternion problem-> conversion


I realize some people would rather use the Mathematica system
quaternions. My answer is that Matrix quaternions can be converted to 
system quaternions as long as you haven't
done something strange to them , like adding {{1,0},{0,0,}} or somthing 
else out of
symmetry.
<< Algebra`Quaternions`
i = {{0, 1}, {-1, 0}};
j = {{0, I}, {I, 0}};
k = {{I, 0}, {0, -I}};
e = IdentityMatrix[2];
q[t_, x_, y_, z_] := e*t + x*i + j*y + k*z;
q[-1/2, 1/2, 1/2, 1/2].q[-1/2, -1/2, -1/2, -1/2]
qM[a_, b_, c_, d_] :=
Quaternion[Re[q[a, b, c, d][[1, 1]]], Re[
    q[a, b, c, d][[1, 2]]], Re[q[a, b, c, d][[1, 2]]], Im[q[a, b, c, d][[1,
    1]]]]
qM[-1/2, 1/2, 1/2, 1/2] ** qM[-1/2, -1/2, -1/2, -1/2]

>
>  
>


  • Prev by Date: Re: How can I graph 3D vectors in Mathematica?
  • Next by Date: Re: NIntegrate's Method ->Oscillatory option
  • Previous by thread: Integrate the Multivariate normal distribution
  • Next by thread: Re: Integrate the Multivariate normal distribution