← Back to team overview

yade-users team mailing list archive

Re: [Question #189336]: Get rotation matrix of clumped spheres

 

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

    Status: Open => Answered

Chareyre proposed the following answer:
Hi Sebastien,

The current rotation is O.bodies[id].state.ori, defined with respect to
the initial orientation.
It is a quaternion, but it is easily converted to a matrix as follows:

Initial state:

Yade [3]: s=O.bodies[10].state
Yade [4]: s.ori
 ->  [4]: Quaternion((1,0,0),0)
Yade [5]: s.ori.toRotationMatrix()
 ->  [5]: Matrix3(1,0,0, 0,1,0, 0,0,1)

... then after some iterations:

Yade [6]: s.ori
 ->  [6]:
Quaternion((-0.01610542244969038,0.64554625934713161,0.76355133580568291),1.2211557600740852)
Yade [7]: s.ori.toRotationMatrix()
 ->  [7]: Matrix3(0.342731,-0.724189,0.598403,
0.710518,0.616535,0.339188, -0.614573,0.308926,0.725855)

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.