Given a symmetric matrix ${\bf S} \in S_n(\mathbb{R})$ and linearly independent vectors ${\bf u}, {\bf v}, {\bf w} \in \mathbb{R}^n$, how can one numerically compute the projection of $\bf S$ onto the following linear subspace?
$$E := \left\{ {\bf N} \in S_n(\mathbb{R}), \{ {\bf u}, {\bf v}, {\bf w} \} \subset \ker{{\bf N}} \right\}$$
Without loss of generality you can assume that $u,v,w$ are orthonormal. If not, use Gram Schmidt. Then complete it with an orthonormal basis $f_4,\ldots,f_n.$ Write the orthogonal matrix $U$ which change the canonical orthonormal basis $e_1,\ldots,e_n$ into $(u,v,w, f_4,\ldots,f_n)$ Write by blocks
$$U^TSU=\left[\begin{array}{cc}S_1&S_2\\S_2^T&S_3\end{array}\right]$$ where $S_1$ is a $3\times 3$ matrix. The projection of $U^TSU$ on $E$ is simply $P=\left[\begin{array}{cc}0&0\\0&S_3\end{array}\right].$ The projection of $S$ on $E$ is $UPU^T.$