Rotation Matrix

In 1st practice exercise C1_W4_lecture_nb_01_vector_manipulation in Example 2 it is said that

Rotation matrix of form
R = [ cos(a) -sin(a)
sin(a) cos(a) ]

are used for counter clockwise rotation when using the equation y = xR (here x is 1x2 shape numpy array)

and are used for clockwise rotation when using the equation y = R(x.T) (here x is 1x2 shape numpy array)

Here a is angle

So if x = [1,0] and a=pi/2 radian (90 degree)

R= [ 0 -1
1 0]

y = xR
y=[0 -1]

Here we see that y = xR produces clockwise rotation

y = R(x.T)
y = [0
1]

Here we see that y = R(x.T) produces anticlockwise (counter clockwise) rotation

I have a question that the description given in Example 2 for using y = xR causes counter clockwise rotation and y = R(x.T) result in clockwise rotation, but for above example y = xR actually result in clockwise rotation and y = R(x.T) actually result in counter clockwise rotation

Please help in verifying this.

Hi Mohit,

You are right. This is also confirmed here. I’ll make a note of this to people working on the backend.

Thanks!