Q: Scale, rotate, and translation operations from four points Given two pairs of points P1 and P2 as well as Q1 and Q2 in 2D-space. I am looking for a sequence of operations that will map P1 to Q1 and P2 to Q2:


*

*scale the coordinates by amount S with origin OS

*rotate the coordinates by angle ALPHA with origin OR

*translate the coordinates by TX and TY


How do I compute the transformation variables? I am looking for S, OS, OR, ALPHA, TX, TY.
If multiple solutions are possible, I am looking for the one that minimizes the translation (TX^2+TY^2).
