## Distance from point to plane in matrix algebra

Given a plane $w^T x = 0$ and a point $x_1$, how do you get the distance between the point and the plane? Better see it as the distance between two parallel planes:

You see the distance is just the length of the projection of $x_1$ on the normal vector $w$:

\begin{align*} d &= \frac{w \cdot x_1}{w \cdot w} w \\ &= \frac{w \cdot x_1}{|w|^2} w \\\\ |d| &= \frac{w \cdot x_1}{|w|} \\ \end{align*}