MATLAB: Given the Rotation Matrix (M), rotate any 2D vector in a counterclockwise by theta (x), then show that M’x rotates the vector clockwise back to the original position

geometric matrix transposehelprotatevector

I have a homework assignment, and I am asked to rotate a vector (v) by the rotation matrix (M), by any angle (x) in a counter clockwise direction, then show that M'x rotates the vector back to the original position.
My code looks like this:
%theta=x
%R=M
v=[100 100]
x=45
R=[cosd(x) -sind(x);sind(x) cosd(x)]
vR=v*R
quiver(0,0,v(1),v(2))
hold on
quiver(0,0,vR(1),vR(2))
S=R'
vS=v*S
quiver(0,0,v(1),v(2))
hold on
quiver(0,0,vS(1),vS(2))
My plot looks like this:

Best Answer

Thanks to both of you!