← Back to team overview

yade-users team mailing list archive

Re: [Question #661262]: How to record the rotation angle of polyhedra?

 

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

    Status: Open => Answered

Bruno Chareyre proposed the following answer:
Yade [3]: q=O.bodies[200].state.ori
Yade [4]: q. +TAB
q.conjugate          q.norm               q.Rotate             q.toAxisAngle        
q.Identity           q.normalize          q.setFromTwoVectors  q.toRotationMatrix   
q.inverse            q.normalized         q.toAngleAxis        q.toRotationVector
Yade [4]: q.toRotationVector()
 ->  [4]: Vector3(0.026689449551319206,0.5930999981956355,-0.3250483718633332)

Note that you will never be able to get the rotation angle (unless 1/
you define mathematicaly what "rotation angle" is in 3D then 2/ you
implement an algorithm to calculate it). What you get from state.ori is
orientation, a rather different thing.

Note2: Euler angles are probably not a good way to go.

Bruno

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