Rotate an image (specified by NxN
matrix) by 90 degrees
the following matrix:
rotation is done taking its center as a pivot point, then the
rotation will be like this:
basically, the matrix is divided into 4 parts by 2 diagonals.
complete the rotation, each part moves to its adjacent part’s
we move one line to its adjacent line, then care needs to be taken
that the lines get progressively smaller as we move towards the
the line gets smaller by 2 pixels, one from the start and one from
below code achieves the above target.
of lines (called layers below) to move in one part = N/2