A matrix class for affine transformations in Python