The conditions suggested in the question give you two equations
which you can solve to find $p'$ and $q'$. Use the same formulation
to give $(p'',q'')$.
explains how 2 by 2 matrices are used to give
transformations of the plane and how you multiply the position
vector of a point by the matrix to find the image of that point
under the transformation.