Let \(H\) be the hyperplane in \(\RNrSpc{n}\) consisting of all \(\Vect{x}=(x_1,\dots ,x_n)\) with
\[a_1x_1+ \cdots + a_nx_n = c,\qquad \Vect{a} = (a_1,\dots ,a_n)\neq (0,\dots ,0)\]Given an arbitrary point \(Q\) in \(\RNrSpc{n}\), there is a unique point \(R\) on \(H\) which is closest to \(Q\). It has the position vector
\[\Vect{r} = \Vect{q}\ -\ \frac{ \DotPr{ \Vect{a} }{ \Vect{q} }\ -\ c }{ \DotPr{\Vect{a}}{\Vect{a}} } \, \cdot\, \Vect{a}\]