Standard reflections

Reflecting across the x-axis sends (x,y)ightarrow(x,y)(x,y) ightarrow(x,-y), while the y-axis sends (x,y)ightarrow(x,y)(x,y) ightarrow(-x,y).

Those special cases are both captured by the same matrix formula for a line through the origin.

Why the angle doubles

The reflection matrix uses cos(2heta)cos(2 heta) and sin(2heta)sin(2 heta) because the vector’s direction is mirrored relative to the line angle hetaheta.

This makes the matrix compact while still handling any origin-based mirror line.