Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out what's the best method to get the distance between two planes where i have the normalized vector of the plane and a point in the plane. What I want to do is to create a parallel plane where 0,0,0 is in and then calculate the distance between the two planes. My thought was that it's actually the same like the distance between the plane and 0,0,0 which I tried just to calculate as the dot product between the normalized vector and the given point.

e.g.: (The values are that strange because they are from a 3D camera system)

{ 0.00102464424908972; -1.5806471007608384E-4; -0.0014898099362794807} // normalized vector (plane normal)
{ 1.2168973210867913; -0.2862541104934054; -0.39146720489920095} //given point
0.0018753452463538794  //calculated distance  ?

I'm not sure but this looks not like the result I expected. Is it the right formula? I tried to use the Hessesche Normalform

Update: somehow I droped my normalize function and the normal was not normalized. now my results look much better. Thankf for all answers.

share|cite|improve this question
up vote 1 down vote accepted

Computing the dot product between the plane normal and the position vector of the given point strikes me as the right solution.

If you imagine the plane and the position vector $x$ from the origin to the given point of the plane, you can drop an orthogonal projection of the origin onto the plane to form a triangle (with the given point and the origin.) The length of the side perpendicular to the plane (=parallel to the plane normal $n$) is exactly $|(x\cdot n)|$.

share|cite|improve this answer

Call $\pi$ the plane, $p$ a point in $\pi$, and $n$ a vector normal to the plane. Let $\pi'$ be the plane through $(0,0,0)$ parallel to $\pi$. Then the distance between $\pi$ and $\pi'$ is indeed given by $\frac{\lvert n\cdot p\rvert}{\lVert n\rVert}$.

To see this, recall that the distance between two parallel planes is given by the length of the segment between any couple of points (one for each plane) lying on a line orthogonal to both. To get the Cartesian equations of $\pi$, let $d=-n\cdot p$ and $n=(a,b,c)$, so that $$ \pi\colon\; ax+by+cz+d=0 $$ and the line through $(0,0,0)$ orthogonal to $\pi$ has parametric equations $$ r\colon \; \begin{cases} x=at\\ y=bt\\ z=ct \end{cases} $$ Intersecting $\pi$ and $r$ gives $$ (a^2+b^2+c^2)\bar{t}+d = 0 \;\Rightarrow\; \bar{t}=\frac{-d}{a^2+b^2+c^2} = \frac{\lvert n\cdot p\rvert}{\lVert n\rVert^2} $$ Finally, the distance between $\pi$ and $\pi'$ is the norm of the vector $(a\bar{t},b\bar{t},c\bar{t})$, i.e. $$ \sqrt{(a\bar t)^2+(b\bar t)^2+(c\bar t)^2}=\lvert \bar{t}\rvert\sqrt{a^2+b^2+c^2}=\frac{\lvert n\cdot p\rvert}{\lVert n\rVert^2}\lVert n\rVert=\frac{\lvert n\cdot p\rvert}{\lVert n\rVert} $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.