# Compute projection

I'm struggling to demonstrate something I read in a book to myself:

The distance from a point $x$ to a hyperplane is denoted as $\mbox{dist}(x,h)$ (perpendicular dstance). Let $x'$ be any point on the hyperplane. Let u be a unit vector that is normal to the hyperplane. Then $\mbox{dist}(x,h) = |u (x-x')|$, the projection of the vector $(x-x')$ onto $u$.

I apologize, but I'm not allow to post diagrams (as i found the hard way when my first attempt at this post practically disappeared).
Although I can see how $\mbox{dist}(x,h)$ is the projection of $|(x-x')|$ on the unit vector $u$, I can't figure out how to show this or how to properly present the problem mathematically.

Any guidance is appreciated!

I will illustrate the problem with a very easy example. Imagine you are in a 3-dimensional space and your plane is the plane $z=0$: the floor of your room. Then, a perpendicular unitary vector to the surface is the $u=(0,0,1)$. Now, let's take the point $x=(1,2,3)$, which is easy to understand that has a distance 3 from the floor (its $z$ coordinate is 3).
Now, let's take another point on the plane, for example $x'=(4,3,0)$. The vector described by these two pints is the $v=(-3,-1,3)$. The projection of the vector over u is $\mbox{proj}(v,u)=v·u=3$ which is the distance between the point and the plane, and does not depend on the point $x'$ you take.
What it is happening here is that the projection is not sensitive to displazements in the directions parallel to the plane. In a general case what you can do is to divide the vector $v=(x-x')=v_{\parallel}+v_{\perp}$, components parallel and perpendicular to the plane. You can demonstrate that the projection of $\mbox{proj}(v_{\parallel},u)=0$ (meaning that the distance will not depend on the point $x'$ on the plane). And the distance is simply the length of $v_{\perp}$ (or equivalently, its projection on $u$).