Hi,
The Google Answers Editors might not see or act upon andrewxmp-ga's
request until Monday, but the Customer (tfpsoft-ga) does not need to
do anything in this circumstance.
While we are waiting, let me go ahead and fill in an observation about
the "cases" that arise in this problem.
As noted there are at least the two cases that one of the two original
spheres is contained entirely in the other, or that an encompassing
sphere will be tangent to each of those two spheres (at farthest
points of intersection along the line drawn through the two spheres'
centers).
To prove that these are the only two possible cases, first note that
the line between the centers is at least well-defined unless the two
centers coincide. If the centers A,B coincide, then clearly the
encompassing sphere would be the larger of the two original spheres.
Assuming the centers A,B are distinct, the vector V = B - A defined by
tfpsoft-ga is nonzero. Let's use the length |V| of this vector rather
than redefine the vector V to be normalized V/|V|.
Thinking of a "number line" generated by distances along the direction
defined by V, we have the first center A at the origin and the second
center B at distance |V| "forward" along the line.
Going backward from A distance r1 (to point C) would correspond to
number -r1 on this line and going forward from B distance r2 (to point
D) would correspond to number |V| + r2. The formulas proposed by
tfpsoft-ga amount to using the interval [-r1, |V| + r2] as the
diameter of a third sphere. Its center is given in tfpsoft-ga's
notation as midpoint (C + D)/2, and its radius would be half the
length of the diameter:
r3 = (|V| + r2 + r1)/2
A B
|--------->
... ---------+----|-------------+---- ...
-r1 0 |V|+r2
C . D
In order for the proposed sphere to encompass the two original spheres
it is necessary and sufficient for the new diameter [-r1, |V| + r2]
to contain the original diameters [-r1, r1] and [|V| - r2, |V| + r2].
To restate the geometric condition algebraically, inclusion of the diameters means:
(1) r1 <= |V| + r2
(2) -r1 <= |V| - r2
If, in the alternative, condition (1) fails, it means that:
r1 > |V| + r2
which implies that the diameter of the second sphere is contained in
that of the first sphere:
[|V| - r2, |V| + r2] contained in [-r1, r1]
Likewise the failure of condition (2) implies:
-r1 > |V| - r2
that the diameter of the first sphere is contained in that of the second:
[-r1, r1] contained in [|V| - r2, |V| + r2]
Therefore tfpsoft-ga's approach "encompasses" all the possibilities!
A couple of notes on generalizations. The basic construction here
works, for two "spheres", in any dimension. This may be glimpsed in
the fact that the argument above reduces the issues to relations among
the one-dimensional diameters of the the "spheres".
If more than two "spheres" are involved, then the problem of finding
an encompassing sphere can be a challenging but algorithmically
tractable one. Even in two-dimensions and with the radii reduced to
zero (points), the problem of a minimal bounding circle is a
fascinating exercise.
regards, mathtalk-ga |