The transformation matrix
popMatrix()have that word in their name.
pushMatrix()puts the current status of the coordinate system at the top of a memory area, and
popMatrix()pulls that status back out. The preceding example used
popMatrix()to make sure that the coordinate system was "clean" before each part of the drawing. In all of the other examples, the calls to those two functions weren’t really necessary because there were no subsequent transformations, but it doesn’t hurt anything to save and restore the grid status. As a best practice, always use those functions when you're doing any transformations.
resetMatrix()function that resets the matrix back to its very original state (the "identity matrix"), but the push and pop functions are nearly always the better approach.