Yes, but as I mentioned that I require expansion, there is a translation followed after the rotation.
A solution I had in mind is to first pad the original images alot, which will then allow me to drop out expanding, and then indeed an easy calculation with a rotation matrix.
However I am still looking for an existing solution for this problem. If there’s no such, then I’ll implement…