Finding a matrix for orthogonal reflection Linear Algebra problem here. I was given the equation of a line and told to find a matrix for it; I found the matrix for orthogonal projection... not reflection.
Here's the problem:
Let W be the line $x = 2t$; $y = -t$; $z = 4t$; $w = -3t$ in $\mathbb{R}^4$. Find the matrix for orthogonal reflection on W in the standard basis.
When finding the projection matrix, I just created a vector out of the equation for the line, normalized it, then multiplied it by itself to produce the $4\times 4$ matrix. This worked, but I don't know a way (if one exists) to convert that matrix into one for reflection instead of projection.
I know that the first column of the matrix is based off the equations for the line, so the first vector is $(2, -1, 4, -3)$. And I know that I use the equations to find the other three vectors for the matrix. Each vector $(x, y, z, w)$ has to be such that: 
$2x - y + 4z - 3w = 0$.
But I can't just pick any number and find the other values. How do I use this equation in a way that will produce vectors that form a basis for reflection and not just a projection? 
 A: You’re very close. You’ve already worked out $P_W$, the orthogonal projection onto $W$, and know that a reflection reverses the component of a vector orthogonal to the reflector. With that in hand, you can construct the reflection matrix. Let $\mathbf v_\parallel = P_W\mathbf v$ and $\mathbf v_\perp = \mathbf v-\mathbf v_\parallel = \mathbf v-P_W\mathbf v$. Then the reflection of $\mathbf v$ in $W$ is $$R\mathbf v = \mathbf v_\parallel - \mathbf v_\perp = \mathbf v_\parallel - (\mathbf v - \mathbf v_\parallel) = 2\mathbf v_\parallel - \mathbf v = 2P_W\mathbf v-\mathbf v = (2P_W-I)\mathbf v.$$ Observe that we haven’t made any assumptions about the subspace $W$. This construction works whether $W$ is a line, plane, &c.  
The approach you mention toward the end of your question has some good ideas, but it looks like you might be getting some of them mixed up. The columns of a transformation matrix are the images of the basis vectors. Unfortunately, this means that the first column of the reflection matrix is not $\mathbf w = (2,-1,4,-3)^T$, the direction vector of the line. If it were, that would mean that the standard basis vector $(1,0,0,0)^T$ gets mapped onto the line, which isn’t at all what you want. On the other hand, if you take $\mathbf w$ as your first basis vector, then relative to that basis the first column of the reflection matrix is $(1,0,0,0)^T$. As stated previously, the reflection reverses orthogonal rejections from $W$, so to continue this construction, find a basis for $W^\perp$ and adjoin it to $\mathbf w$. Relative to this basis, the reflection matrix is simply $\operatorname{diag}(1,-1,-1,-1)$ and a change of basis back to the standard basis will give you the required reflection matrix. All that remains is to find three linearly-independent vectors that are all orthogonal to $\mathbf w$, which can be done by inspection.
