[Math] Orthogonal Projection of a vector onto intersection of k hyperplanes

linear algebra

let $v$ be a vector, and $\forall i \in 1..k < n : n_i$ be normal vectors of hyperplanes in the in an $R^n$ space. the problem is to compute orthogonal Projection of $v$ onto intersection of all those planes.

I'm looking for an n*n matrix (M), so that $vM = Projection(v)$

Here are two examples: $$n=3, k=2, n_1=(1,0,0), n_2=(0,1,0) \Rightarrow p(1,1,1) = (0,0,1)$$$$n=3,k=2,n_1=(1,0,-1),n_2=(0,1,-1) \Rightarrow p(0,0,1)=({1 \over 3},{1 \over 3},{1 \over 3})$$$$n=3,k=1,n_1=(0,0,1) \Rightarrow p(1,1,1) = (1,1,0)$$

Best Answer

Orthonormalize the normal vectors (e.g. using Gram–Schmidt), then project them out. In vector notation, projecting out a normal vector $n_i$ from a vector $v$ yields

$$ v\to v-(v\cdot n_i)n_i\;; $$

in matrix notation, this is

$$ v\to\left(I-n_in_i^\top\right)v\;; $$

and the matrix operation for projecting out all $k$ orthonormal vectors in one go is

$$ v\to\left(I-\sum_in_in_i^\top\right)v\;. $$

Note that this only works for orthonormal normal vectors $n_i$; you can't apply it directly to your second example, in which the normal vectors aren't orthonormal.

P.S.: It's been pointed out that the question uses a row vector convention. To transform the answer to that convention, simply transpose everything and toggle the transposition markers, which yields

$$ v\to v\left(I-\sum_in_i^\top n_i\right)\;. $$

Related Question