I am trying to mirror an array. This is the array I am given
1.0 2.0 3.0 4.0
5.0 6.0 7.0 8.0
9.0 10.0 11.0 12.0
13.0 14.0 15.0 16.0
and I need to transform it to this
1.0 2.0 3.0 13.0
5.0 6.0 10.0 14.0
9.0 7.0 11.0 15.0
4.0 8.0 12.0 16.0
This is the code I wrote but I am not getting the same thing. Where am I going wrong?
ok, so you want to mirror arcoss the top left to bottom right diagonal only the elements in the bottom half including the diagonal of the diagonal from bottom left to top right. That is a little odd, but it should be doable.
what I would do is write a standard mirror function to start, one that flips everything across the top left to bottom right diagonal.
once that works, apply logic to filter it (ideally, by doing less work) so it only operates on the elements you want.