# How to Derive Point on Plane from Normal Vector : geometric Margins

Consider the snippet below from Andrew Ng's lecture notes on Support Vector Machines.

He goes on to state that $B = x^{(i)} - \gamma^{(i)} \frac{w}{\|w\|}$. I am having a hard time seeing why this is the case (calculus very very rusty). Can anyone describe the steps to arrive at this value?

## 1 Answer

Their $\gamma^{i}$ is the distance from the point $A$ to the plane. The closest point $B$ on the plane to $A$ is the orthogonal projection of $A$ onto the plane; orthogonal projection onto a plane and closest point projection are always the same, regardless of dimension. That is, $A-B$ must be in the direction of the normal $w$ to the plane. In this case, apparently the vector from $B$ to $A$ is in the same direction as $w$. Therefore, if the distance from $A$ to the plane is $\gamma^{i}$, then $$A=B+\gamma^{i}\frac{1}{\|w\|}w$$ or $$A-\gamma^{i}\frac{1}{\|w\|}w=B.$$

• Can I say this back and see if I understand? $\vec{AB}$ is equal to $\vec{A} - \vec{B}$. Since we know that $\vec{AB}$ is in the direction of $\frac{w}{||w||}$ and has magnitude $\gamma$ then we know that we can scale $\frac{w}{||w||}$ by $\gamma$ as a representation of $\vec{AB}$. Thus, we can write $\vec{AB}$= $\gamma$ $\frac{w}{||w||}$ or $\vec{A} - \vec{B}$ = $\gamma$ $\frac{w}{||w||}$ or $\vec{B}$ =$\vec{A} - \gamma$ $\frac{w}{||w||}$ Nov 14, 2014 at 0:38
• @B_Miner : That's it! Nov 14, 2014 at 1:00
• Yeah! Thanks! Appreciate it TAE Nov 14, 2014 at 1:46