← Back to team overview

yade-users team mailing list archive

Re: How se3 and ori is stored

 

Hi, I updated a little relevant section in the Programmer's manual at
https://yade-dem.org/sphinx/prog.html#basic-numerics .

> 1) Ori is declared as Quaternionr.  So, it should be [q0,q1,q2,q3].
Quaternions are automagically _represented_ as axis-angle, for
readability, though internally stored as 4 components (as written in the
referenced doc).

> 2) I've seen "b2->state->ori.Conjugate()".   According to the
> Quaternion.inl file, "ori" has to be stored as q0+q1+q2+q3 for the
> conjugate to be calculated.
same as above

> 3) When we declare orientation = [1,0,0,0] are we saying q0=1, q1=0,
> q2=0, q3=0?  
This construction is invalid in both Python and c++. In python:

q=Quaternion(1,2,3,4)
print q[0],q[1],q[2],q[3]  ## show components
print q                    ## show quaternion (as axis,angle)
## note that angle is zero, it must be normalized to be meaningful
q.Normalize()
print q

> There seems to be automatic conversions between [q0,q1,q2,q3] and
> [ [axisX,axisY,axisZ],angle ], of which I'm not aware.  Can someone
> please enlighten me?  
Example?





Follow ups

References