Is there a mathematical method that takes a matrix and generates a "diamond" of values from rotating it 45 degrees?
I’m writing a program that simulates a game, and to do so I need to come up with a function that can rotate a matrix by 45 degrees, essentially. So if I have a 5 by 5 matrix, I need to generate a list of lists looking like:
3,1 4,2 5,3
etc etc all the way down to 1,5
I’m wondering how an operation like this would work…thanks!
This question is in the General Section. Responses must be helpful and on-topic.