Prove that the ratio of lengths of parallel segments is invariant under affine trasnformations The complete question is as follows:


  Prove that under an affine transformation the ratio of lengths on
  parallel line segments is an invariant, but that the ratio of two
  lengths that are not parallel is not.


Now, the way I was going to prove is the following but I cannot find a way to continue, so maybe I'm missing something.

We have an affine transformation in the form:
$$H = \begin{matrix}
        a &amp; b &amp; x \\
        c &amp; d &amp; y \\
        0 &amp; 0 &amp; 1 \\
        \end{matrix}$$
I deleted the previous wrong stuff which I had written previously. Now this should be the correct definition of affine transform and clear the confusion.

Now, let's assume we have two lines $l_1$ and $l_2$ and we pick two points lying on each one of them: $p_1$, $p_2$ on $l_1$ and $p_3$, $p_4$ on $l_2$. We calculate the distance of each pair of points:
$$d_1 = \sqrt{(p_{1x} - p_{2x})^2 + (p_{1y} - p_{2y})^2}$$
This is the distance between the points on the first line, we can then calculate the distance $d_2$ between the points on the second line and then the ratio $d_1 / d_2$.

Then I thought I could apply the transformation $H$ to the points and calculate the new distances and thus the new ratio. Constraining the lines to be parallel should now make the ratios equal and prove the sentence. I'm pretty sure this procedure is indeed correct conceptually but I find it very hard to go on since the resulting expressions of the ratios are not that simple (ratios of square roots). Is there a better/simpler way to achieve the same result?
Your $H$ is a linear transformation, not an affine one. Write $H(x) = Ax + b$ with $A\in\mathbb R^{2\times 2}, b\in\mathbb R^2$ instead. Using this directly shouldn't be too hard, noting that the things you describe are given by
$$p_1-p_2 = \lambda (p_3-p_4)$$
and you have to show that
$$H(p_1)-H(p_2) = \lambda (H(p_3)-H(p_4))$$
Your $H$ is a linear transformation, not an affine one. Write $H(x) = Ax + b$ with $A\in\mathbb R^{2\times 2}, b\in\mathbb R^2$ instead. Using this directly shouldn't be too hard, noting that the things you describe are given by
$$p_1-p_2 = \lambda (p_3-p_4)$$
and you have to show that
$$H(p_1)-H(p_2) = \lambda (H(p_3)-H(p_4))$$