$(X-P) - (N\cdot(X-P))N = (I - NN^T)(X-P)$
I see a text about Orthogonal projection onto a plane, and this formula I cann't understand, can someone please explain to me, or give me some guide information, I have learn algebra some long time ago, which I forget most of it
\begin{align} (X-P) - (N\cdot(X-P))N&=(X-P)-N^T(X-P)N \qquad\text{note that $N^T(X-P)$ is a scalar} \\ &=(X-P)-NN^T(X-P)\\ &=(I-NN^T)(X-P) \end{align}