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 minimum of |Y[s]-X[t]| for all values of s and t.
Since the square is an increasing function, we may as well solve the easier problem of minimizing the square of the distance
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 X[2]=(2,0,0) to Y[-1]=(2,2,-1) is perpendicular to both lines,
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.
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.
31.3
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.
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
The squared distance function is
One solution we found was x1=0.979, x2=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.