Effacer les filtres
Effacer les filtres

How can I do a Method which returns a Rotation Matrix?

4 vues (au cours des 30 derniers jours)
Faruk Alioglu
Faruk Alioglu le 16 Nov 2022
Commenté : Torsten le 16 Nov 2022
Hello,
I want to implement the method rotTheta(phi, theta), which returns a rotation matrix containing a vector when multiplied ¨ φ degrees about an axis rotates, which is defined by y = x tan(θ).
I know how to implement a rotation matrix over the x,y- and z-axis but I'm not sure how to do the mentioned method. It would be a pleasure if you could help me.

Réponses (1)

Torsten
Torsten le 16 Nov 2022
syms theta phi
M = [cos(theta) -sin(theta) 0;sin(theta) cos(theta) 0;0 0 1]*[1 0 0;0 cos(phi) -sin(phi);0 sin(phi) cos(phi)]*[cos(theta) sin(theta) 0;-sin(theta) cos(theta) 0;0 0 1]
M = 
  2 commentaires
Faruk Alioglu
Faruk Alioglu le 16 Nov 2022
Thank you very much, could you also explain what you did?
Torsten
Torsten le 16 Nov 2022
  1. Rotate by -theta about the z-axis to make your axis of rotation y = tan(theta)*x to fit with the x-axis (M1).
  2. Rotate by phi about the x-axis (M2).
  3. Rotate back by theta about the z-axis (M3).
  4. The complete rotation is then described by M = M3*M2*M1.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by