The line y= x is exactly 45 degrees from both the x and y axes. "Reflecting points in a line basically rotates the entire plane around that line. Because the angles are equal, the positive x axis reflects into the positive y axis and vice-versa. The point (x, y) reflects to (y, x).