Add function to create affine matrix from user input