# Distance from a point to a line and from point to plane

I understand why when we have a point from a point say $P=(p,p,p)$ to a line say $x=c+nt$, $y=c+nt$ and $z=c+nt$, where $N=(n,n,n)$ is the normal the distance from one to the other is we find a point say $S$ on the line and then make a vector from the line to the point and then we project it thus: $$proj_{\vec{N}}\vec{PS} = \left\|\vec{PS}\right\|\sin{\theta}= \frac{\left\|PS \times N\right\|}{\left\|N\right\|}$$

This just comes out from a triangle and how cross product is defined. But why when we do it with a plane and a point we get the following?

$$proj_{\vec{N}}\vec{PS} = \left\|\vec{PS}\right\|\cos{\theta}= \frac{\left\|PS \cdot N\right\|}{\left\|N\right\|}$$

I know I am missing something, because to me the projection of PS seems like it should be identical.

• I really don't understand your English! :) I was just confused reading the first few lines! :) – H. R. Oct 23 '15 at 22:14
• O SORRY I am confused why the formula for a distance from a point to a line is different than the one for a point to a plane – Kori Oct 23 '15 at 22:22

The reason is because they are not both normal vectors. In the case of the line, the vector that you are calling $N$ is in fact the direction vector - going along the line. In the case of the plane, the normal vector is perpendicular to the plane, so is at $90^\circ$ to the plane. This means that the two problems are rotations of each other: one is sin and the other is cos.