Added affine transformation functions (these had gotten removed somehow)