While your problem has been solved, the answer is actually pretty easy.

When working with matrixes – specifically, a 2D matrix – the assumption is that you have a square like this. Your matrix tells it where you want that square to end up. You write the position of points B and C. You can drag them and the square will stretch, rotate, and flip around as you do so, but always maintaining point A at the origin (0,0). If you move point C from 1 to -1, the image will flip horizontally.

The following matrix:

```
| 1 0 | = C is at (1,0)
| 0 1 | = B is at (0,1)
```

Produces no transformation. The following one:

```
| -1 0 | = C is at (-1, 0)
| 0 1 | = B is at (0,1)
```

Flips it horizontally.

Now, since point A always stays at (0,0), you can’t slide the image around. You can rotate, skew, stretch, etc. but one corner is always stuck on the origin. So what they do is, if they want to freely transform an image that is in 2D is work in 3D. If I have a cube sitting on a table and I put a 2D image on the face of the cube that’s lifted off the table by the body of the cube, while the corner of the cube that’s sitting on the table is stuck at (0,0), the face that is raised can be moved around freely. When I go to extract the image, I just slice off the top face at whatever (X, Y) coordinates it was at and display it.

If I’m working with a 3D cube and I just want to flip, not move, the image, all I have to do is ignore the third column and row.

```
Cube with no transformation:
| 1 0 0 |
| 0 1 0 |
| 0 0 1 |
Cube flipped horizontally:
| -1 0 0 |
| 0 1 0 |
| 0 0 1 |
```

Possibly they’ll have the bottom-right value be 0 rather than 1 as the default, which is the same as compacting the cube down to being flat like a piece of paper. If so, that’s fine. Just put 0 in there.