Question: how to rotate or flip a matrix ?

i have a work on Magic Squares , and i need to rotate or flip them to all 8 possible directions .
but i am confused to find such special commands in maple for doing my purpose !

may you guide me how can i do this programmaticaly ?

 

order4 := Array(1 .. 4, 1 .. 4, {(1, 1) = 8, (1, 2) = 11, (1, 3) = 14, (1, 4) = 1, (2, 1) = 13, (2, 2) = 2, (2, 3) = 7, (2, 4) = 12, (3, 1) = 3, (3, 2) = 16, (3, 3) = 9, (3, 4) = 6, (4, 1) = 10, (4, 2) = 5, (4, 3) = 4, (4, 4) = 15}, datatype = anything, storage = rectangular, order = Fortran_order)

order4 := Array(1..4, 1..4, {(1, 1) = 8, (1, 2) = 11, (1, 3) = 14, (1, 4) = 1, (2, 1) = 13, (2, 2) = 2, (2, 3) = 7, (2, 4) = 12, (3, 1) = 3, (3, 2) = 16, (3, 3) = 9, (3, 4) = 6, (4, 1) = 10, (4, 2) = 5, (4, 3) = 4, (4, 4) = 15})

(1)

``


Download magicsquare4.mw

Please Wait...