Why does reflecting a point (x,y) about y=x result in point (y,x)?

I noticed that whenever reflecting a point (x,y) about the line y=x the x and y coordinates become swapped in order to give (y,x). However, I do not know why this is the case. Is there any way to geometrically/mathematically prove that this will always happen?


Solution 1:

Because the segment joining $(x,y)$ to $(y,x)$ is in the direction of the vector $(x,y)-(y,x)=(x-y)\cdot(1,-1)$ hence it is orthogonal to the line $L=\{(u,v)\mid u=v\}$ whose direction is the vector $(1,1)$, and because its middle point is on $L$. These two properties (orthogonality+middle point) characterize the reflection about $L$.

Solution 2:

Consider the points $A(x,x)$, $B(y,y)$, $M(x,y)$, and M' the reflexion of $M$.

$AM=BM=|x-y|$, and therefore by reflexion $AM'=BM'$. Thus $AMBM'$ is a parallelogram (we proved its a rhombus, and it's actually a square). From there coordinate calculations, be it by vector equalities or the fact that $[MM']$ and $[AB]$ share a middlepoint $\left(\frac{x+y}{2},\frac{x+y}{2}\right)$, gives you the result.