You are viewing a single comment's thread. Return to all comments →
Suppose you are trying to rotate a 4x5 matrix by 9 places.
1,1 1,2 1,3 1,4 1,5 2,1 2,2 2,3 2,4 2,5 3,1 3,2 3,3 3,4 3,5 4,1 4,2 4,3 4,4 4,5
After rotation it will look like
4,3 4,2 4,1 3,1 2,1 4,4 ........... 1,1 4,5 ........... 1,2 3,5 2,5 1,5 1,4 1,3
So define a function that maps 1,1 to 4,3, 1,2 to 4,2, etc. There's no reason to actually rotate this in memory.
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Layer Rotation
You are viewing a single comment's thread. Return to all comments →
Suppose you are trying to rotate a 4x5 matrix by 9 places.
After rotation it will look like
So define a function that maps 1,1 to 4,3, 1,2 to 4,2, etc. There's no reason to actually rotate this in memory.