Matrix Rotations

James Blackburn

January 2022

1 Using the angle between two vectors

First of all, we can define the 2x2 matrix inversion in the variable R as:

Where θ is the anti- clockwise angle of rotation.
               [cosθ  - sinθ]
           R =  sinθ   cos θ
(1)

(2)
The general form of vectors is:
    [ ]
     x
⃗v =  y
(3)
Now let’s take the identity matrix:
    [   ]
I =  1 0
     0 1
(4)
Now, let’s take the vector of the positive x-axis and the positive y-axis:
    [ ]
⃗a =  1
     0
⃗   [0]
b =  1
(5)

(6)
And rotate this by the matrix R:
    [           ][ ]   [    ]
⃗c = cosθ  - sinθ 1  =  cosθ
     sin θ  cosθ   0     sin θ
⃗  [cosθ  - sinθ] [0]  [- sin θ]
d = sinθ   cosθ   1 =   cosθ
(7)

(8)

Using this function, we can give evidence of the dot product between two vectors.
The dot product is defined as such (where a and b are random variables):

cosθ = xa ×-xb +-ya ×-yb
           |a|× |b|
This can be re-arranged to find θ (theta):
         (               )
θ = cos-1  xa ×-xb +-ya ×-yb
               |⃗a|× |⃗b|
Now let’s find the rotation between ⃗a & ⃗c and ⃗b & ⃗d :
          (                            )
        -1  -----1×-cosθ-+-0×-sinθ------
 θ1 = cos   √12-+-02 × ∘ (cos-θ)2 +-(sin-θ)2
             (                         )
      = cos-1  ----------c∘osθ----------
               √12-+-02 ×  cos2 θ+ sin2θ
                                 (cosθ )
                          = cos-1  -----
                                  1 ×1
                            = cos- 1(cosθ)
                                     = θ
          (                            )
θ2 = cos-1  √----0-×--s∘inθ+-1-×cosθ------
             02 + 12 × (- sinθ)2 + (cosθ)2
              (           cosθ         )
       = cos-1  √---------∘-------------
                  02 + 12 × sin2θ +( cos2θ )
                               -1  cosθ-
                           = cos    1× 1
                             = cos-1 (cosθ)

                                      = θ
(9)

(10)
Therefore, we have proved that the rotation matrix R rotates a vector by the angle θ.

Alongside this proof, we have also managed to prove another fact: Given any 2d matrix, one can instantly tell if it’s a rotation matrix by the following test:

     [    ]
A  =  a  b
∘ ----c- d
  a2 + c2 = 1
∘ -2---2
  b + d = 1
(11)

(12)

(13)
Because:
∘ ------------
∘ cos2θ+-sin2θ-= 1
  sin2θ+ cos2θ = 1
(14)

(15)

2 Clockwise or anti-clockwise

Considering that a rotation is always going to be in the range 0 θ 360 and considering the 3 functions we use in the matrix R are sinθ, cosθ and -sinθ, we can plot these functions onto a graph:

      sin θ
      cosθ
0611233--001θf028406 1 0.5(00000.θ5)  -sinθ

Figure 1: Domain: 0 θ 360, Range: -1 f(θ) 1

Now, let’s consider what an anti-clockwise and clockwise rotation actually is. Because we know that the matrix R gives an anti-clockwise rotation, we know that 0 θ 180 is anti-clockwise, hence 180 θ 360 is clockwise.

Let’s zoom in to the cosθ graph:

        cosθ acw
0611233--001θf028406 1 0.5(θ00000.)5    cosθ cw

Figure 2: Domain: 0 θ 360, Range: -1 f(θ) 1
Can you see how it doesn’t matter whether the rotation is clockwise or anti-clockwise? It is negative or positive in either of these cases. This means we can forget about the cosine graph for now! Let’s move onto sinθ and -sinθ!

      sin θ
0611233--001θf028406 1 0.5(θ00000.)5  -sinθ

Figure 3: Domain: 0 θ 360, Range: -1 f(θ) 1
Can you see how the graphs converge at 180o? This means that in the domain 0 θ 180 (anti-clockwise), 0 sinθ 1 and -1 ≤-sinθ 0. Hence, for the domain 180 θ 360 (clockwise), -1 sinθ 0 and 0 ≤-sinθ ≤-1.

But what does this actually mean for a mathematician? Well, it means, given the following rotation matrix:

    ⌊       √-⌋
      1   - -3-
B = ⌈ 2√-    2 ⌉
      23-   12

We can see that B12 (the top right corner) is negative. Therefore, it is an anticlockwise rotation!

Now let’s take another matrix C:

    [  1--  1-]
       √2   √2
C =   -√1-  1√--
         2   2

We can see that C21 (the bottom left corner) is negative. Therefore, it is a clockwise rotation!