← Back to team overview

yade-users team mailing list archive

Re: [Question #687331]: How does the orientation of particle work in YADE?

 

Question #687331 on Yade changed:
https://answers.launchpad.net/yade/+question/687331

Jan Stránský proposed the following answer:
Hello,

(apart from what Jerome already wrote)

1) x,y,z,w can be any number in general.
x**2+y**2+z**2+w**2=1 hold for **unit** quaternions (which Yade uses)

> is the w component a radians or a real number?

is there a difference?
w is internally a real number, you can access the internals as a.state.ori[0], a.state.ori[1], a.state.ori[2], a.state.ori [3] (have a look on Eigen / minieigen documentation which index correspond to x,y,z,w, I think (but I am not sure and don't want to search it right now) that the order is not x,y,z,w

> a.state.orientation=...

a.state.ori is the attribute (not orientation)

> a.state.orientation=(10,10,10,10),how will the code responds?

the easiest way is to try yourself :-)
a.state.ori=(10,10,10,10) # error, as Jerome pointed
a.state.ori = (10,10,10),10 # ok, 1st argument is axis, 2nd is angle
print(a.state.ori) # you get axis-angle representation, not x,y,z,w directly, see above

cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.