I am working on a program that require to transform the plane according to a matrix. Although I am working on a 2D plane I am using 3D matrices, so that it can encorperate translation as well. All points on the plane have their normal x and y coordinates, along with a z coordinate of 1. When I say "the plane" I mean the plane $z=1$.
This matrix in question is of the following form: $$M=\begin{bmatrix} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{bmatrix}$$
The constraints mentioned in the title are that there are two points, $A$ and $B$, that need to move to $A'$ and $B'$ respectively. I also want this transformation to not skew the plane, preserving the shape of objects on it, and just translate, rotate, and scale it.
I have managed to reduce it to two unknowns and fix the points, but I don't know how to fix the skew and remove the other unknowns. I have calculated $$c=\frac{B'_x-A'_x-aB_x+aA_x}{B_y-A_y}$$ $$d=\frac{B'_y-A'_y-bB_x+bA_x}{B_y-A_y}$$ $$e=A'_x-(aA_x+cA_y)$$ $$f=A'_y-(bA_x+dA_y)$$