Question: MATLAB 0 1 0 Exercise 1. [50 points.] A rotation matrix is a fundamental tool used to rotate objects in 3D space, with numerous applications
MATLAB
![MATLAB 0 1 0 Exercise 1. [50 points.] A rotation matrix is](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa46404bd05_01566fa463fc3a0c.jpg)

0 1 0 Exercise 1. [50 points.] A rotation matrix is a fundamental tool used to rotate objects in 3D space, with numerous applications ranging from robotics, aerospace, and computer graphics. Given the orthogonal axes xyz it is possible to define a counterclockwise rotation of 0 radiants around each axis using 1 0 cos(0) 0 sin(0) R2(0) 0 cos(0) sin(0) Ry(0) 0 O sin(0) cos(0) - sin(0) 0 cos(0). (cos(0) sin(0) 0 Rz(0) = sin(0) cos(0) 0 0 0 Write a MATLAB Script to perform the following: a) Use plot 3 to draw a red vector for x = [1 0 0), a green vector for y = [0 1 0] and a blue vector for z = [0 0 1]. Set LineWidth=2 for all three lines; Hint: You need two points to draw a line. Remember that all vectors you are asked to draw should be connected to the origin. 1 b) Use grid and axis to draw a grid and set the axes between 1 and +1 in all three directions. Also, use hold to ensure that all future plots get added to this one; c) Define the column vector w = 0.5[1; 1; 1] (why not a row vector?) and plot it using a thick (i.e. width = 2) black line; d) Use a for loop to compute wi = Rx(O)w for 30 evenly spaced values of 0 [0, ] and plot each vector as a thin (i.e. standard width) red line. Finally, plot the last vector wi = Rz()w as a thick magenta line; e) Given wi = Rz()w, repeat the previous step for w2 Ry(0)w1, given 40 evenly spaced values of [0, $]. Use thin green lines for all vectors except the last one, which should be a thick cyan line; f) Given w2 Ry(TT)W1, repeat the previous step for w3 R2(0)w2, given 20 evenly spaced values of 0 [0, ]. Use thin blue line for all vectors except the last one, which should be a thick black line; g) Given the rotation matrix Ru Rz (T)RyGT)Rx (t), compute u = Ruw and plot it as a thick dashed yellow line; h) Given the rotation matrix Re = Rz()Ry()Rz (7), compute e = Rew and plot it as a thick dotted black line. = Can you explain why u = W3, whereas e + w3? 0 1 0 Exercise 1. [50 points.] A rotation matrix is a fundamental tool used to rotate objects in 3D space, with numerous applications ranging from robotics, aerospace, and computer graphics. Given the orthogonal axes xyz it is possible to define a counterclockwise rotation of 0 radiants around each axis using 1 0 cos(0) 0 sin(0) R2(0) 0 cos(0) sin(0) Ry(0) 0 O sin(0) cos(0) - sin(0) 0 cos(0). (cos(0) sin(0) 0 Rz(0) = sin(0) cos(0) 0 0 0 Write a MATLAB Script to perform the following: a) Use plot 3 to draw a red vector for x = [1 0 0), a green vector for y = [0 1 0] and a blue vector for z = [0 0 1]. Set LineWidth=2 for all three lines; Hint: You need two points to draw a line. Remember that all vectors you are asked to draw should be connected to the origin. 1 b) Use grid and axis to draw a grid and set the axes between 1 and +1 in all three directions. Also, use hold to ensure that all future plots get added to this one; c) Define the column vector w = 0.5[1; 1; 1] (why not a row vector?) and plot it using a thick (i.e. width = 2) black line; d) Use a for loop to compute wi = Rx(O)w for 30 evenly spaced values of 0 [0, ] and plot each vector as a thin (i.e. standard width) red line. Finally, plot the last vector wi = Rz()w as a thick magenta line; e) Given wi = Rz()w, repeat the previous step for w2 Ry(0)w1, given 40 evenly spaced values of [0, $]. Use thin green lines for all vectors except the last one, which should be a thick cyan line; f) Given w2 Ry(TT)W1, repeat the previous step for w3 R2(0)w2, given 20 evenly spaced values of 0 [0, ]. Use thin blue line for all vectors except the last one, which should be a thick black line; g) Given the rotation matrix Ru Rz (T)RyGT)Rx (t), compute u = Ruw and plot it as a thick dashed yellow line; h) Given the rotation matrix Re = Rz()Ry()Rz (7), compute e = Rew and plot it as a thick dotted black line. = Can you explain why u = W3, whereas e + w3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
