So, I was thinking on how to define a rotation of a board mathematically, but on an $n \times n$ board where if you get past the last column/row you get back to the first, so basically it's $\mathbb{Z}_n \times \mathbb{Z}_n$.
But I was having trouble with the definition so I thought: what if someone already defined a rotation of the board and I don't need to waste my time?
So... Is there a definition for a function $\phi: \mathbb{Z}_n^2 \rightarrow \mathbb{Z}_n^2$ which makes a rotation of the board on angles $\frac{\pi}{2}$ and $-\frac{\pi}{2}$ (don't really need other angles)
And while on that subject, is there also a way to define a mirroring of the board towards any of the two main diagonals? i.e: $d_l: (x,y) \in \mathbb{Z}_n^2: y = x$ and $d_r: (x,y) \in \mathbb{Z}_n^2: y + x = n+1$?
Of course; consider the maps $$\phi(x,y)=(y,-x)\qquad\text{ and }\qquad d_l(x,y)=(y,x).$$