Rotates a 2D ndarray