The distance between lines, between curves, between a curve and a surface, etc. is a multidimensional minimization problem. "The distance" means the shortest distance as the points vary over both objects. Most calculus books do not treat this topic, because the solution of the equations resulting in the critical point step is too hard to do by hand. The computer can help you solve these deep geometrical problems.

The linear cases of these distance problems can usually be solved with vector geometry and justified by the Pythagorean theorem, but it is worthwhile seeing the calculus solutions even in these cases.

Two lines are given by parametric equations as follows:

Find the distance between these lines; that is, minimize the distance between a point on line 1 and a point on line 2. Analytically, we have the question,

FIND: The minimum of |* Y[s]-X[t]*| for all values of

Since the square is an increasing function, we may as well solve the easier problem of minimizing the square of the distance

The partial derivatives of

The critical point condition is the system of equations

with single solution

Notice that the critical point condition for lines is a system of two linear equations in *s* and *t*. Solving this is a high school algebra problem.

You could use geometric or analytical reasoning to answer the last question.
Analytically, we could introduce a "fake" compact set for the *(s,t)* domain, say
and
with both *S* and *T* huge.
How large is *D[s,t]* on the boundary of the fake domain? Why does *D[s,t]* have both a max and min on the fake domain? Why is the min inside?

**Example 31.1**
* Geometry of the Critical Point*

The vector * V* pointing from

The direction of line 1 is

Why must this perpendicularity be true?

- 1.
Find the distance between line 1 in the direction
*(1,-1,1)*through the point*(0,1,0)*and line 2 in the direction*(1,2,1)*through the point*(2,2,2)*. Is the segment connecting the two minimizing points perpendicular to both lines? - 2.
Find the distance between line 1 and line 3 in the direction
*(1,2,1)*through the point*(2,1,2)*. Is the segment connecting the two minimizing points perpendicular to both lines? *3. Let line be given by the parametric equations*and line be given by the parametric equations**X**[s]=**P**_{1}+s**V**_{1}. We want to minimize**Y**[t]=**P**_{2}+t**V**_{2}

Show that

Suppose that*s*and_{0}*t*are the critical solutions where these partials are zero. Show that the segment connecting_{0}and**X**[s_{0}]is perpendicular to both**Y**[t_{0}]and**V**_{1},**V**_{2}

(Hint: Substituteand**X**[s_{0}]=**P**_{1}+s_{0}**V**_{1}in the equations and compare with the partials.)**Y**[t_{0}]=**P**_{2}+t_{0}**V**_{2}

Figure 31.1: The Curvesand**X**[s], or the simpler square of the distance,**Y**[t]

*Find the specific set of critical point equations for this minimization problem*

and solve them with the computer.The computer's exact solution function may not be powerful enough to find exact solutions to the equations that arise from minimizing the distance between these curves, but the computer can approximate roots if you know a starting point. Look at Figure 31.4 above and say which roots are near the initial guess

*s=4*and*t=2*. Then calculate the result using a numerical solver such as*Mathematica's***FindRoot[ ]**by making appropriate initial guesses. Remember that the computer can compute the partial derivatives for you as part of the solution program.*We got solutions**(x*,_{1},x_{2})=(2.053,2.917)*(y*and_{1},y_{2})=(2.827,3.537)*(x*,_{1},x_{2})=(-1.557,-3.419)*(y*. Are these the min and the max? Which pair of points minimize the distance between a point on the ellipse and a point on the branch of the hyperbola?_{1},y_{2})=(3.515,2.845)Use the computer to help you be sure you have what you need. For example, Figure 31.7 is a plot of the distance as a function of the parameters.

Figure 31.2: Distance versus*(s,t)**Is the segment connecting the minimizing points perpendicular to both curves?***31.3**An Implicit-Parametric Approach

We want to treat*D*as a function of*x*and*t*where*y*is determined by the constraint.

This differential is the local linear approximation to the change in the square distance function, so the critical values occur where it is the zero funciton.

*Solve the three equations*

with your computer's numerical equation solver. We got one solution*x=2.053*,*y=2.917*,*t=2.827*.Examples 19.9, 19.11, and the program

**SvVarMxMn**from the main text find the distance from a point to a surface. We can generalize those examples to find the distance from a line or a curve to a surface.**31.4**Distance from a Curve to a Surface

Figure 31.3: A Curve and SurfaceThe squared distance function is

*Numerically solve the equations*

One solution we found was

*x*,_{1}=0.979*x*,_{2}=0.744*t=0.728*. Is this the minimum distance?**Problem 31.1**You can easily invent any number of interesting distance problems yourself now and solve them with a combination of calculus and computing.

Previous project Next project Close this window