# How to understand "rotate" function in sixDoFRigidBodyMotion?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 4, 2017, 23:19 How to understand "rotate" function in sixDoFRigidBodyMotion? #1 New Member   Join Date: Mar 2017 Posts: 4 Rep Power: 9 Hi, everyone I recently read the code of sixDoFRigidBodyMotion class. There is a function rotate in this class and the corresponding code is shown as following: inline Foam::Tuple2 Foam::sixDoFRigidBodyMotion::rotate ( const tensor& Q0, const vector& pi0, const scalar deltaT ) const { Tuple2 Qpi(Q0, pi0); tensor& Q = Qpi.first(); vector& pi = Qpi.second(); tensor R = rotationTensorX(0.5*deltaT*pi.x()/momentOfInertia_.xx()); pi = pi & R; Q = Q & R; R = rotationTensorY(0.5*deltaT*pi.y()/momentOfInertia_.yy()); pi = pi & R; Q = Q & R; R = rotationTensorZ(deltaT*pi.z()/momentOfInertia_.zz()); pi = pi & R; Q = Q & R; R = rotationTensorY(0.5*deltaT*pi.y()/momentOfInertia_.yy()); pi = pi & R; Q = Q & R; R = rotationTensorX(0.5*deltaT*pi.x()/momentOfInertia_.xx()); pi = pi & R; Q = Q & R; return Qpi; } I don't know why five rotation should be carried out in this function? Is there any comments for this treatment?

 September 26, 2020, 13:01 #2 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 616 Rep Power: 16 Did you find an answer? What's the exact reason to rotate in this order: first half angle around the x-axis, then half angle around y-axis, than the full angle around the z-axis, the half angle around the y-axis and last half angle around the x-axis?

 Tags motionsolver, rigidbody, rotate, sixdofrigidbodymotion