Example 4:  Give a coordinate rule for reflecting in the line y = x.

Solution:  Again let the point and its image have coordinates (x, y) and (p, q), respectively.  The line y = x is a 45o line through the origin, and the relation between the point and its image looks like this:

 

If we draw horizontal and vertical segments from the axes through the points and to the line y = x, we have the following:

 Since the green line is at 45o, we can focus on two squares to see that q = x and p = y:

Thus, the coordinate rule is:  (x, y) --> (y, x)

That is, when reflected in the line y = x, the coordinates of any point are transposed.