Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Distance from point to z=xy

  1. Oct 13, 2011 #1
    1. The problem statement, all variables and given/known data
    Hello, looking for some help regarding the shortest distance from a point to z=xy.

    Perhaps some advice?

    If R=(X, Y, Z) is the point on the surface closest to P=(0, 0, 1), then L[\b] is a vector normal to the surface and L[\b]=Xi+Yj+(z-1)k

    n[\b]=yi+xj-k is the normal vector, and there exists some scalar quantity such that L[\b]=tn[\b]

    thus, ty=X, tx=Y, z-1=-t

    From here. no matter what it seems like i cant do anything...

    thanks in advance!!!!
  2. jcsd
  3. Oct 13, 2011 #2


    User Avatar
    Science Advisor

    If I understand well, the equation of a plane tangent to the surface at a point is:


    Maybe you can minimize the function d((0,0,1), (x,y,xy))
  4. Oct 13, 2011 #3
    can you elaborate a bit on that???
    Ive never seen it done that way haha
  5. Oct 13, 2011 #4
    Ive tried two different approaches, however, they all seem to end up with variables in the answer..
  6. Oct 14, 2011 #5


    User Avatar
    Science Advisor

    Do you mean finding the minimum:

    I guess what you were doing, if I understood correctly, was projecting into the normal vector right?

    If not, the general distance(squared) from (0,0,1) to (x,y,xy) , i.e., the surface z=xy, is:


    The minimum here would be given by the point in the surface that minimizes the distance.

    Just plain calculus gives you the minimum.
  7. Oct 14, 2011 #6
    as far as I know, I have not learnt how to calculate max/min values with a multivariable function. We are just learning the definition of a partial derivative. I may be mistaken though.
  8. Oct 14, 2011 #7
    I figured it out. With a little bit of digging I found some notes on critical points for partial derivatives. Thanks again! I found the minimum distance to be 1, as x=0 and y=0 were critical points.
  9. Oct 16, 2011 #8


    User Avatar
    Science Advisor

    Good deal.Glad it helped.
  10. Oct 17, 2011 #9


    User Avatar
    Science Advisor

    This problem leads naturally to the "Lagrange multiplier" method. If we want to find the point on the surface closest to point p, we can calculate the gradient, the vector pointing in the direction of fastest increase, of the distance function. Since we want "decrease" to get closest, we would want to move in the direction opposite to the gradient. But that will point off the surface so the best we can do is move in the direction of the "projection" of the (reverse) gradient on the surface. We can do that until there is NO projection. That occurs, as you said initially, when the gradient is perpendicular to the plane. And if we write the plane in the form F(x,y,z)= constant, we know that [itex]\nabla F[/itex] is normal to the surface. That is, to minimize the distance function (or its square) to a point not on the plane, the two gradients must point in the same direction- one must be a multiple of the other.

    In this case, it is easier to work with distance squared, [itex]D2(x,y,z)= x^2+ y^2+ (z- 1)^2[/itex] for a any point (x,y,z) on the surface. Its gradient is [itex]2x\vec{i}+ 2y\vec{j}+ 2(z-1)\vec{k}[/itex]. We can write the surface as f(x,y,z)= xy- z= 0, a constant. Its gradient is [itex]\vec{i}+ \vec{j}- \vec{k}[/itex].

    The two gradients must be parallel so one must be a multiple of the other:
    [tex]2x\vec{i}+ 2y\vec{j}+ 2(z- 1)\vec{k}= \lambda(\vec{i}+ \vec{j}- \vec{k})[/tex]
    where [itex]\lambda[/itex], the "Lagrange multiplier" is the constant multiple.
    That gives three equations: [itex]2x= \lambda[/itex], [itex]2y= \lambda[/itex], [itex]2(z- 1)= -\lambda[/itex].

    I find that the simplest way to eliminate [itex]\lambda[/itex], which is not relevant to the solution, and solve the equations is to divide one equation by another. For example, if we divide the first equation by the second we get [itex]2x/2y= x/y= 1[/itex] or just y= x. If we divide the first equation by the third, we get [itex]2x/2(z-1)= x/(z-1)= 1[/itex] so x= z- 1.

    Of course, the point (x,y,z) lies on the plane so we can use the equation of the plane, xy= z together with y= x= z- 1 to find the specific values of x, y, and z.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook