Mathematics 138
Isometries of Euclidean Plane Geometry
(These notes omit many proofs that can be found in Ryan, Chapter 1)
Let d(X, Y) denote the distance between two points X and Y of the Euclidean plane E2. An isometry of the plane is a mapping T of E2 onto itself with the property that for every X and Y,

d(TX, TY) = d (X,Y)

The isometries of E2 satisfy the axioms for a group (Ryan, Appendix C).

0. (Closure) The product of two isometries is an isometry.
1. (Associativity) (T1 T2) T3 = T1(T2 T3)
2. (Identity) The identity mapping I, with IX = X for all X, is an isometry.
3. (Inverse) Each T has an inverse T-1 which is also an isometry.
The most obvious isometries are rotations about the origin. These are linear transformations that can be represented by matrices with determinant 1, of the form

Reflections about a line though the origin are also isometries.  Such a reflection is also a linear transformation with determinant -1, represented by a matrix of the form
 for reflection about a line that makes an angle of q with the x axis.
An easy way to confirm this is to note that  is an eigenvector of this matrix with eigenvalue 1.
A rotation about a point other than the origin is also an isometry, but it is not a linear transformation of E2 (since it does not leave the origin fixed).  A translation is also an isometry that does not leave the origin fixed.  So is a reflection about a line that does not pass through the origin.
To represent isometries by matrices (nearly essential for a computer implementation), we consider linear transformations of R3 that transform the plane z = 1 into itself and preserve the scalar product
<x, y> = x1 y1 + x2 y2 (note -- this ignores the third component of each vector!)
A point P or Q is now represented by a 3-component vector  or 
and the distance function d(P, Q) = 

Now a translation is easily represented by a matrix of the form

Geometrically, this represents a "shearing" of 3-dimensional space that carries the unit vector along the z axis, , into the vector  and thereby moves the origin of the plane z = 1 into the point (a, b).
More generally, a Euclidean isometry is represented by a matrix of the form

, where the 2x2 matrix in the upper-left-hand corner has determinant +1(rotation) or -1 (reflection).  The entire 3x3 matrix also has determinant +1 or -1.
This set of 3x3 matrices also satisfies the group axioms.  It is closed under matrix multiplication (proof --- brute-force computation).  Matrix multiplication is associative, there is an identity, and a matrix with determinant +1 or -1 has an inverse with the same determinant.

Remarkably, the form of isometry for which it is easiest to write down the matrix is a reflection in an arbitrary line!   This is done using vectors.
Let l be a line in the plane z = 1 passing through point P, and let N be a unit vector parallel to the plane z = 1, normal to the line l   (Note: P is represented by a vector whose third component is 1, while N is a vector whose third component is 0).  The distance from an arbitrary point X to the line l is D = <X-P, N>.  So X - DN lies on the line l.  To get the "mirror image" of X in l, we simply go as far again on the other side of l.  

X' = X - 2 DN = X - 2 <X-P, N> N.
If you think of X as a two-component vector, this is not a linear transformation, since (0,0) gets transformed into 2<P,N> N.  But if you think of X as a three-component vector you can make this into a linear tranformation.  Let I be the identity matrix: then

X' = I X - 2 <N,X> N + 2 <P,N> N.
The first two terms are linear in X and lead to a 2x2 reflection matrix.  The third term is an extra translation that shows up in the image of 
The full matrix is M = 
The matrix M has a plane of eigenvectors. This plane is spanned by two vectors with eigenvalue 1.
One is the vector  that represents the point P. 
The other is a vector , where 
LxNx+LyNy =0. These vectors determine a plane through the origin that includes the line l.
The third eigenvector, with eigenvalue -1, is of course the vector N.

The matrix M has the property that any plane of the form z = a is mapped into itself, though not point by point. Instead, each point in the plane is reflected in a line, the intersection of the plane
z = a with the plane of eigenvectors.

Following Ryan, we call an isometry a "motion" if it is the product of a finite number of reflections. It turns out that every isometry is a motion, and that no more than three reflections are needed.  The same result will also hold in elliptic and hyperbolic geometry.
Case 1: Reflections in a pencil of parallel lines.
All the lines of the pencil are perpendicular to a line l, and so in Euclidean geometry they are all parallel to one another.  So we can specify any line of the pencil by a unit normal vector N along the direction of l and by a point (P, Q, etc.) that may as well be chosen to be the intersection with l.
Two and three reflections:

If Wn denotes reflection in n and Wm denotes reflection in m, then the product 

X'' = Wm Wn X = X + 2 (P - Q)
So the product is a translation along the direction of line l.
A matrix for one reflection in a vertical line (determinant -1):

A matrix for the product of two such reflections (determinant +1).

With three reflections in parallel lines, the product is a single reflection in a suitably chosen line of the pencil:
Wr Wm Wn X =Wr (X + 2 (P - Q)) = X + 2 (P - Q) - 2 <N, X + 2 (P - Q) - R>N
			= X + 2 (P -Q) - 2 <N, P - Q> N - 2 <N, X - (R + Q - P)> N
			= X - 2 <N, X - (R + Q - P)> N
Memory aid: the point with the minus sign is the one on the line used for the second of the three
reflections.

Case 2: Reflection in a pair of intersecting lines.

WIthout loss of generality, we can assume that the point of intersection is the origin. For a line through the origin that makes angle q with the x axis, the unit normal is N = (-sin q, cos q).
We can figure out the 2x2 matrix for this linear transformation by looking at the action of the reflection on the unit vectors (1,0) and (0,1).
If X = (1,0), then <N, X> = -sin q.
Since the line passes through the origin, P may be taken as (0,0).
Using Wq X = X - 2<N, X - P> N = X - 2<N, X> N
If X = (1,0), WqX = (1,0) + 2 sin q (-sin q, cos q).
If X = (0,1), Wq X = (0,1) - 2 cos q (-sin q, cos q).
So the matrix for Wq is= 
Now we can compute the product of two reflections by matrix multiplication.

Thus Wq Wf = 
= 
This matrix, with determinant +1, describes a rotation about the origin.
A matrix for a reflection about a line through the origin

A matrix for the product of two such reflections -- a rotation matrix

If the lines intersect at a point other than the origin, then the result of two successive reflections is still a rotation about the point of intersection, which is the same as a rotation about the origin followed by a translation. 
Reflection about a line
(determinant -1)
Product of two reflections
(determinant +1)

If we carry out three successive reflections about lines through the origin, the result is
a rotation followed by a reflection.

WyWq Wf = 

=
This is just a reflection about a line whose angle with the x-axis is y -q + f.

Memory aid: the angle with the minus sign is the one associated with the line about which the second of three reflections is carried out.
Generalization and summary:

For a pencil of parallel lines
the product of any even number of reflections is a translation perpendicular to the lines.
the product of any odd number of reflections is a reflection in another line of the same pencil.

For a pencil of concurrent lines that intersect at a point P

the product of any even number of reflections is a rotation about P.
the product of any odd number of reflections is a reflection in another line of the same pencil.