Question: Let's review our rotation matrices to practice our coding skills. Given a PSI rotation angle, the corresponding rotation matrix is given by For a given

Let's review our rotation matrices to practice our coding skills.
Given a PSI rotation angle, the corresponding rotation matrix is given by
For a given rotation of
We can write this out in code as:
psi =10;
psi_in_radians = deg2rad(psi);
Rz_psi =[ cos(psi_in_radians), sin(psi_in_radians),0;
-sin(psi_in_radians), cos(psi_in_radians),0;
0,0,1];
We can do the same for the other angles theta and phi.
It can be tedious to write this all out whenever we need to create a rotation matrix. Instead, we should create a function.
Write a function that allows a user to select the axes of rotation and the amount of the rotation (in degrees).
Use strings with " for the text entry
"phi" or "x" for a rotation
"theta" or "y" for a rotation
"psi" or "z" for a rotation
The input should be in degrees as well.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!