Solution (source code)

= Solution

Under an orthogonal Cartesian change of axes $Q$, the <vector> components transform as $v_i'=Q_{ia}v_a$, while $v_k'v_k'=v_av_a$ and $\delta_{ij}=Q_{ia}Q_{ja}$. Substitution gives
$$
P_{ij}'=\delta_{ij}-\frac{Q_{ia}v_aQ_{jb}v_b}{v_cv_c}=Q_{ia}Q_{jb}\left(\delta_{ab}-\frac{v_av_b}{v_cv_c}\right)=Q_{ia}Q_{jb}P_{ab}.
$$
This is the rank-two <Cartesian tensor> transformation law. The nonzero assumption ensures that the denominator is positive. In <matrix> form $P=I-vv^T/(v^Tv)$ is the <orthogonal projection matrix> onto the <orthogonal complement> of $v$.