Note. if this only needed for affine transformations, then the bottom row can be hard coded to 0,0,1 This will simplify the maths.
A single reflection will cause points within a path to be ordered in the opposite direction (clockwise/anticlockwise). This can cause trouble, because the direction of the path determines if it is treated as a hole or a solid.
This performs a 3x3 matrix times by a 1x3 matrix, adding an extra 1.0 for the z value of the 1x3 matrix.