Originally Posted by

**Scott H** The dot product $\displaystyle \mathbf{p}\cdot\mathbf{q}$ increases when $\displaystyle \mathbf{p}$ and $\displaystyle \mathbf{q}$ point in the same direction, and drops to $\displaystyle 0$ exactly when $\displaystyle \mathbf{p}$ and $\displaystyle \mathbf{q}$ are perpendicular.

Therefore, $\displaystyle \mathbf{s}$ will be perpendicular to $\displaystyle \mathbf{q}$ when

$\displaystyle \begin{aligned}

\mathbf{s}\cdot\mathbf{q}&=(k\mathbf{p}-(\mathbf{p}\cdot\mathbf{q})\mathbf{q})\cdot\mathbf {q}\\

&=k(\mathbf{p}\cdot\mathbf{q})-(\mathbf{p}\cdot\mathbf{q})|\mathbf{q}|^2\\

&=(\mathbf{p}\cdot\mathbf{q})(k-|\mathbf{q}|^2)\\

&=0.

\end{aligned}$

Here, we have used the formula $\displaystyle \mathbf{q}\cdot\mathbf{q}=|\mathbf{q}|^2$.