Eric Arnebäck on Twitter: "Below, I have written down a concise and sweet derivation of the 2D rotation matrix, for future reference. Following this, the 3D rotation matrices can easily be derived,
Rotate a matrix by 90 degree without using any extra space | Set 2 - GeeksforGeeks