there is more than one isometry that does this. we get two seperate rotations that take y = x to y = -2x (one through some angle θ, and one through π+θ).
on the other hand, if we let i = 1, this takes the line y = x, to the line y = -x (well, actually, the line -y = x, but so what?), and we have two different rotations that map y = -x to y = -2x.
after each 4 of these elements of O(2), we can translate using (0,1) to get the desired affine isometry.
explicitly, here is one such mapping:
let i = 0. this is the "identity" reflection (not reflecting at all). note that:
the next step is to compute θ. let's rotate counter-clockwise. the angle we want is:
then we have:
if we want to obtain a specific matrix for this rotation, we can rotate by the two angles (3π/4 and -arctan(2)) separately:
(if i did my arithmetic and geometry right, i dislike calculation like this )
finally, we translate by (0,1), giving the transformation:
so let's see if we map points on y = x to points on y = 1 - 2x, and preserve the distance.
for our 2 test points, i'll pick (0,0) and (4,4). clearly S takes (0,0) to (0,1) and 1 = 1 - 2(0), so that is on our target line. a brief (for you, maybe) calculation shows that S takes (4,4) to the point (-4√10/5, (8√10 + 5)/5), and again:
(8√10 + 5)/5 = 1 - 2(-4√10/5), so that, too, is on our line.
now the distance between (0,0) and (4,4) is 4√2. let's see what the distance between our 2 image points are:
i'm convinced, how about you?