← Back to team overview

yade-users team mailing list archive

Re: Quaternion question

 

Anton Gladky пишет:
> Hello all!
>
> I have a quaternion question.
> I have two of them:
>   Q1 (0, 0, 1, PI/4) (around axis OZ)
>   Q1 (0, 1, 0, PI/6) (around axis OY)
> My box should be rotated using first quaternion, and the a second one. It is
> a new topic for me. Can anybody advice me, what should I do to solve this
> task?
You can product them:
if M - first rotation and Q - second rotation, then final rotation R is
R = Q*M = (q0+q)*(m0+m) = q0 m0 - q Dot m + q0 m + m0 q + q Cross m,
where q and m is the vector part of quaternions; q0 and m0 is the its
scalar part.

I don't know if there is quaternion product from python in YADE
(Vaclav?), but from c++ it is simply as:

Quaternion3r Q,M,R;
R = Q*M;

ps. Also you can see formulas and references in Appendix of my PhD
thesis (in russian): http://dl.getdropbox.com/u/714488/DorofeenkoPhD.pdf






Follow ups

References