Help me with math and explain the answer to me

SOLUTION
If the triangle is reflected across the line y = x, then
We will switch the coordinates of y to that of x and, the coordinates of x to that of y
The coordinates for the points of the triangle are
[tex]\begin{gathered} Q(-5,\text{ 2)} \\ \\ R(0,\text{ 5)} \\ \\ S(-1,\text{ 2)} \end{gathered}[/tex]The reflection becomes
[tex]Q^{\prime}=(2,-5),R^{\prime}=(5,0),S^{\prime}=(2,-1)[/tex]Therefore option D is the correct answer