Rotate a box using transformation matrix in Python.