I need some help creating a rotation matrix that describes a 90-degree counterclockwise rotation around the point $c=(2,1)$. I understand that to rotate around a point other than the origin, I need to translate the point to the origin, rotate it, and then translate it back to its original position. I also need to test the matrix using the points $(2,2)$ and $(1,1)$, so that the green figure's head is mapped onto the brown figure's head.
From what I understand, to rotate around a point other than the origin, we need to first translate the point to the origin, rotate it, and then translate it back to the original position.
Here's what I've attempted so far:
- Translate point $c$ to the origin: $$ \left[\begin{array}{ccc} 1 & 0 & -2 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{l} x \\ y \\ 1 \end{array}\right]=\left[\begin{array}{c} x-2 \\ y-1 \\ 1 \end{array}\right] $$
- Rotate the point 90 degrees counterclockwise around the origin: $$ \left[\begin{array}{cc} 0 & -1 \\ 1 & 0 \end{array}\right]\left[\begin{array}{c} x-2 \\ y-1 \end{array}\right]=\left[\begin{array}{c} -(y-1) \\ x-2 \end{array}\right] $$
- Translate the point back to its original position: $$ \left[\begin{array}{lll} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{c} -(y-1) \\ x-2 \\ 1 \end{array}\right]=\left[\begin{array}{c} -y+2 \\ x-1 \\ 1 \end{array}\right] $$
However, I'm not sure if this is correct. I don't know how to test if the matrix maps the point $(2,2)$ to $(1,1)$ as described in the question. If anyone could help me out or give me some tips, I'd really appreciate it!