# Finding the distance from a point to a plane using substitution

1. Apr 18, 2013

### mrcleanhands

If I want to find the distance from a point to a plane.
E.g. (2,1,-1) to the plane x+y+z=1

I know that distance from one point to another is given by:
$\sqrt{(x-2)^{2}+(y-1)^{2}+(z+1)^{2}}$

And in this case the solution is to substitute in z=x+y-1 which fits nicely giving us:
distance=$\sqrt{(x-2)^{2}+(y-1)^{2}+(x+y)^{2}}$

What I'm trying to work out in my own mind is why substituting that in will suddenly give us the distance from the plane to the point.

I think that x,y are still arbitrary points in 3D space but when we substitute in the stuff for Z (nice/formal way of saying this anyone?) now x,y are allowed to be arbitrary points in 3D space since if Z is forced to be on the plane then x,y should fall on the plane.

However, if you have a tilted plane I can visualize a case where z is on the level of the plane but x,y are running off somewhere else...

and btw for those of you guys answering questions here. I can't tell you how much more enjoyable this forum has made maths for me (I was starting to dislike it a lot). I'm able to delve into all the little details I wasn't before. Thank you!

Last edited: Apr 18, 2013
2. Apr 18, 2013

### Staff: Mentor

Where do those -1, -1, +1 come from? That is certainly not the formula for the distance of your point. You should use your specific point here, not something else.

It does not, you still have two variables there.

3. Apr 18, 2013

### Staff: Mentor

Your distance formula gives the distance from an arbitrary point P(x, y, z) to Q(1, 1, -1). There's nothing in your formula that pertains to the point (2, 0, -3), which needs to be in your distance formula.

4. Apr 18, 2013

### mrcleanhands

It's 4AM here... I just edited the question.

I don't want to substitute in points from the plane for x,y,z because I want to be able to find the derivative of this Distance function and then minimize it. So I want to understand how I can make sure I'm minimizing the right distance...

5. Apr 18, 2013

### mathman

In order to get the distance from a point to a plane, you need to do the following.
1) Define a vector perpendicular to the plane - in your case Q = (1,1,1) will do.
2) Get the intersection of a line starting at your given point, directed along the perpendicular. Let P be your original point. So the line is described by P + sQ.
3) Plug this into the equation for the plane. (2+s) + (1+s) + (-1+s) = 1.
4) Solve for s = -1/3. The distance is now |s|√3 = 1/√3.

6. Apr 18, 2013

### Staff: Mentor

The problem can also be worked using the approach that mrcleanhands suggests - by finding the minimum value through calculus of the distance between the specified point and an arbitrary point on the plane.

It's simpler to work with the square of the distance than with the distance itself. After all, the point that minimizes the distance also minimizes the square of the distance. You would want to minimize
f(x, y) = D2 = (x - 2)2 + (y - 1)2 + (1 - x - y + 1)2

Since this is a function of two variables, you'll need to use partial derivatives, and set both of them to zero.

The problem can also be done using a technique called Lagrange multipliers. See http://en.wikipedia.org/wiki/Lagrange_multiplier.

7. Apr 19, 2013

### mathman

Just wondering. Why use a more roundabout approach, when the simple method (no calculus) will do?

8. Apr 19, 2013

### mrcleanhands

In this case it's just a matter of learning about an application of partial derivatives.

So the thing I don't get here is why:
f(x, y) = D2 = (x - 2)2 + (y - 1)2 + (1 - x - y + 1)2 is going to give you the distance^2.
If you have a flat plane which is only on one value of Z then yes it will work, but if the plane is tilted then you can no longer just take any value of x,y as it won't necessarily be on the plane anymore even if it's the right Z value.

9. Apr 20, 2013

### mathman

This gives the distance to a particular point on the plane. The next step is to find the (x,y) pair which minimizes: ∂f/∂x = 0, ∂f/∂y = 0. Solve for x and y.