Rotate matrix: to fix new coordinates formula