Indeed, it is necessary to use two matrices
For an object named polygonName, we will have:
Matrix = polygonName.GetMg ()
inverseMatrix = ~ Matrix
Matrix converts local coordinates to global coordinates.
After finishing working in global coordinates, we return to local coordinates with inverseMatrix
We can thus modify the polygon with the new local coordinates.
These two matrices allow to work with the points, which is very convenient.
This subject is very well explained here:
Link