[matrix] write code for rotate image