Question 8: Rotations in homogeneous coordinates. Create a function called rotat
ID: 3196196 • Letter: Q
Question
Question 8: Rotations in homogeneous coordinates. Create a function called rotateCangle_in_deg). Be sure your function suppresses all output, as we will want to use it later inside a large for loop. This function should return the matrix R shown below, where we have defined d = angle-in-deg. cosd -sind 0 R=|sin d cos d 0 Be sure your trig functions handle degrees. Get help on both cos and cosd When a 2D vector (x,y) is represented in (3D) homogeneous coordinates as x = yl, this matrix does exactly what you would expect, it rotates the vector by the given angle cos d -sin d 01 x[xcos d y sin d Rx=|sin d cos dolly-lxsin d + y cos d 0 0 1 Question 8: Paste your code for rotate(angle_in_deg) here, then include the output for the line included near the bottom. Show the result for the following command. >rotate 90 3 4: 1Explanation / Answer
function R = rotate(d)
R = [cosd(d) -sind(d) 0 ; sind(d) cosd(d) 0 ; 0 0 1]
end
rotate(90)*[3 ;4 ; 1]
R =
0 -1 0
1 0 0
0 0 1
ans =
-4
3
1
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.