While I was studying for my exam, I found Stanford's EE263 course's old homework questions and this particular one attracted my attention, however couldn't solve it. If you can help me, I will really appreciate it!
Find the matrix $Q \in R^{n*n} $ such that the reflection of $x$ through the hyperplane $\left\{ z | a^Tz = 0\right \}$ is given by $Qx$. Verify that matrix $Q$ is orthogonal. (To reflect $x$ through the hyperplane means the following: find the point $z$ on the hyperplane closest to $x$. Starting from x, go in the direction $z-x$ through the hyperplane to a point on the opposite side, which has the same distance to $z$ as $x$ does. )