# Finding the closest point on a plane and a given point

I have a plane, and a point and I am able to interchange between the plane equation and parametric equation quite well now.

I recently figured out how to find a point on the line thats the closest to another point by using the dot product set to zero. I would get the parametric equations for the line of interest and then find its directional vector. Id find the vector from the line to the point and dot product these set to 0, solve for t and resubstitute into my parametric equations.

Im having trouble doing this with planes though, mostly due to the fact of two variables but also I cant visualize how the line connecting the plane to the point will be a perpendicular one. My problem is im rotating this plane in my mind and the line connencting the plane to the point might not be perpendicular.

First can someone tell me the method to use to find the point on the plane closest to that point, and then maybe help me with my visualization.

Thank you

• Are you familiar with the method of Lagrange Multipliers to find max/min values? Jan 12, 2016 at 22:25
• no we have not done that, however I did something interesting to find the least distance between two points earlier, I differentiated a function of t that represented the distance between a point and a line, set it to zero for a mix/max and solved for t, is this similar? Jan 12, 2016 at 22:42
• yes! that is a somewhat similar idea. Good intuition. you're looking at "constrained optimization," although some multivariable machinery is required before you deal with lagrange multipliers (gradients and such.) I've answered an alternative method, hopefully it makes sense. Jan 12, 2016 at 22:51

Say that you have

a plane: $ax+by+cz=d$

and a point: $(f,g,h)$.

The basic idea is that because of the ways that planes are constructed (with two different vectors), a perpendicular one will be the cross product of these vectors. Consequently, you can always find a perpendicular vector to a plane (think about putting a stick in the mud, and moving it around a 2-d surface.) This vector looks like: $[a,b,c]$.

For a "proof" of this, consider the following 2 points on the plane:

$(x_{1},y_{1},z_{1})$ and $(x_{2},y_{2},z_{2})$.

Since they are on the plane, they both satisfy the following equation:

$$ax_{1}+by_{1}+cz_{1}=d$$ and $$ax_{2}+by_{2}+cz_{2}=d$$

Now, by subtraction we have that: $$(ax_{1}-ax_{2})+by_{1}-by_{2}+cz_{1}-cz_{2}=0$$ or, better yet: $$[a,b,c]\cdot[x_{1}-x_{2},y_{1}-y_{2},z_{1}-z_{2}]=0$$

Since $[x_{1}-x_{2},y_{1}-y_{2},z_{1}-z_{2}]$ is a vector made by points on the plane, it is a vector on the plane. Since the dot product is zero, $[a,b,c]$ is perpendicular to this vector.

Now you more explicitly want a "line" given by a parametric that has the direction of $[a,b,c]$ and that goes through the point $(f,g,h)$. But then, just look at: $(x,y,z)=(f,g,h)+t[a,b,c]$. Then you have three different equations for $x,y,z$. Substitute them into the original equation for the plane:

$(x,y,z)=(f,g,h)+t[a,b,c]$ implies that:

$x=f+ta$

$y=g+bt$

$z=h+ct$

Then, by substitution into the first equation for the plane:

$a(f+ta)+b(g+bt)+c(h+tc)=d$

Now you have one variable ($t$) and a bunch of constants so you can solve for $t$ and figure it out!

To provide further intuition: take the stick in the mud picture, and imagine, say... some piece of dust floating (and static) in space above the ground. First you want to get the stick directly under the piece of dust (orient it in the mud so that it is perpendicular and right below the piece of dust)-- then solve for how long the stick needs to be until it reaches it, (solve for the scalar, $t$.) If you can do that, you will find a "line" that goes through the point and intersects the plane perpendicularly.