I know formulas. I say about implementation.
I need more info because of I am lazy and I do not want calculate myself precise (float) offsets of center and corners (pixels) after every step.
I found codes for pixel pecision only (i say about position of origin of rotation). It is simple.
Pixels are discrete, shears are not.
I know how to do first shear correctly (i implement it in prepared next version).
But next steps parameters must be changed too and unclear for me how.
Anyway, Shear may be useful Avisynth function too.