This might help: In-place matrix transposition.
(You might also have to do some mirroring after the transposition, as rlbond mentions).
This might help: In-place matrix transposition.
(You might also have to do some mirroring after the transposition, as rlbond mentions).