Hesse normal form and how to calculate the smallest distance to a point

geometrylinear algebra

I want to show that the smallest distance of a point to a hyperplane (given by $\langle x, n \rangle + d = 0$, where $n$ is the normal of the plane with$\|n\|_2=1$ and $d\in\mathbb{R}$ is given by putting the point into the equation of the plane.

My proof: We call $P_H$ the projection onto the hyperplane and want to show that
\begin{align*}
\|p-P_H p\|_2 = d(p,H) \overset{!}{=} |h(p)| = |\langle p, n \rangle + d|.
\end{align*}

Since $p-P_H p\in H^\perp$, we get $p – P_H p = (\lambda-d) n$ for some $\lambda\in\mathbb{R}$. With that, we get
\begin{align*}
|h(p)| &= |\langle p, n\rangle+d| = |\langle p,n\rangle – \langle P_H p, n\rangle+d| = |\langle p – P_h p, n\rangle + d| \\
&= |\lambda| = |\lambda| \cdot\|n\|_2 = \|\lambda n\|_2 = \|p-P_h p + \lambda n\|_2.
\end{align*}

Where is my mistake?

Right solution: We call $P_H$ the projection onto the hyperplane and want to show that
\begin{align*}
\|p-P_H p\|_2 = d(p,H) \overset{!}{=} |h(p)| = |\langle p, n \rangle + d|.
\end{align*}

Since $p-P_H p\in H^\perp$, we get $p – P_H p = \lambda n$ for some $\lambda\in\mathbb{R}$. With that, we get
\begin{align*}
|h(p)| &= |\langle p, n\rangle+d| = |\langle p,n\rangle – \langle P_H p, n\rangle + \underbrace{\langle P_H p, n\rangle}_{=~-d} + d| = |\langle p – P_h p, n\rangle | \\
&= |\lambda| = |\lambda| \cdot\|n\|_2 = \|\lambda n\|_2 = \|p-P_h p\|_2 = d(p,H).
\end{align*}

Even better solution (wrong definition in the first one, I want to keep the orientation): We call $P_H$ the projection onto the hyperplane and want to show that
\begin{align*}
\lambda = d_{\text{or.}}(p,H) \overset{!}{=} h(p) = \langle p, n \rangle + d,
\end{align*}

where $\lambda\in\mathbb{R}$ is the unique number such that $p = P_H p+\lambda n$. It exists because of $p-P_H p\in H^\perp$. We have
\begin{align*}
P_H p + h(p) n &= P_H p + \big(\langle p, n\rangle+d\big)n = P_H p + \Big(- \langle P_H p, n\rangle + \underbrace{\langle P_H p,
n\rangle}_{=~-d} + \langle p, n\rangle + d\Big)n \\
&= P_H p + \langle p – P_H p, n\rangle n = P_H p+\lambda n = p,
\end{align*}

where we used that $P_H p$ lies in the hyperplane and therefore fulfills $\langle P_H p, n\rangle + d = 0$.

Best Answer

When you write

$$|\langle p, n\rangle+d| = |\langle p,n\rangle - \langle P_H p, n\rangle+d|$$

you are replacing $p$, the vector from origin to that point, with $p - P_h$, the difference vector to the projected point. The two are not equal.

What you can do is subtract the projected point then add it back in. Knowing that the projected point is on the plane, you can replace one of these two inner products with $-d$ and use that to cancel $d$, while the other can be moved into the inner product the way you did.

Related Question