You have an affine map, which you can formulate easily using homogeneous coordinates:
$$\begin{pmatrix}x'\\y'\\1\end{pmatrix}=
\begin{pmatrix}a&b&c\\d&e&f\\0&0&1\end{pmatrix}\cdot
\begin{pmatrix}x\\y\\1\end{pmatrix}$$
Or in equations: $x'=ax+by+c$ and $y'=dx+ey+f$. Now given three points and their images, you have six pairs of coordinates, leading to six equations for the six unknowns. But you probably better stick to $3\times3$ matrix notation.
$$\begin{pmatrix}n_1&-n_2&n_3\\-n_7&n_6&n_4-n_5\\1&1&1\end{pmatrix}=
\begin{pmatrix}a&b&c\\d&e&f\\0&0&1\end{pmatrix}\cdot
\begin{pmatrix}0&1&0\\0&0&1\\1&1&1\end{pmatrix}$$
You can take the inverse of the matrix on the right to obtain
$$
\begin{pmatrix}a&b&c\\d&e&f\\0&0&1\end{pmatrix}=
\begin{pmatrix}n_1&-n_2&n_3\\-n_7&n_6&n_4-n_5\\1&1&1\end{pmatrix}\cdot
\begin{pmatrix}-1&-1&1\\1&0&0\\0&1&0\end{pmatrix}=
\begin{pmatrix}-n_1-n_2&-n_1+n_3&n_1\\n_6+n_7&n_4-n_5+n_7&-n_7
\\0&0&1\end{pmatrix}
$$
Does this map preserve orientation? Compute its determinant, check the sign. Identity matrix has determinant 1 and preserves orientation. So positive sign is orientation-preserving, negative sign is orientation-reversing.
Is this map an isometry? If so, $a=e$ and $b=-d$ and $a^2+b^2=1$ for orientation-preserving case. $a=-e$ and $b=d$ for reversing. Think about them as $\sin$ and $\cos$ in a rotation (or reflection) matrix.
Do all of this for the alternate position of $Z$ as well. The points are collinear if the determinant of the matrix is zero.