OK, so I know a qautrnion can represent a certain transformation of a basis. Generally a quaternion of the form
$$a+b\mathbf{i}+c\mathbf{j}+d\mathbf{k}$$
Uniformly expands the basis by $g=\sqrt{a^2+b^2+c^2+d^2}$, rotates the basis around the vector defined by $(b,c,d)$ with an angle $\theta=2acos(a/g)$. Basically it transforms a cube to a rotated, resized cube. I think.
Is there a similar complex-ish formulation for an affine transformation? i.e. that can transform a cube to a rotated rectangular prism? Purpose is to do some statistical analysis on such transforms, which seems simpler (still not very simple) as a complex variable than as a deformation tensor.