# For given column vectors $x$, $y$ how to find an orthogonal matrix $Q$ such that $Qx=y$

Problem: Given $$x=[1,7,2,3,-1]^T$$and $$y=[-4,4,4,0,-4]^T$$, find an orthogonal matrix $$Q$$ such that $$Qx=y$$.

My attempt: I know the definition of an orthogonal matrix. By definition, if $$Q$$ is an orthogonal matrix then $$Q^{-1}=Q^T$$. Further, I know if system of equations $$Ax=b$$ where $$A$$ is square matrix, has a solution if $$b$$ is in column space of $$A$$ i.e. if $$rank(A:b)=rank(A)$$.

• Look up Householder reflection. – Chris Custer Jan 1 at 7:04
• Sir, I didn't know the notion of the Householder reflection. Can't we solve directly? – Akash Patalwanshi Jan 1 at 7:09

If you let $$v=\frac{x-y}{\mid\mid y-x\mid\mid}$$.
$$A=I-2vv^t$$ should do the trick.