6
x0**2+x1**2+x2**2-1;
x0*x3+x1*x4+x2*x5;
 50*x0**2-2*x0*x4+ 14*x0*x5+x1**2-14*x1*x2+ 2*x1*x3+ 49*x2**2-14*x2*x3+x3**2
+x4**2+x5**2-1;
 29*x0**2-10*x0*x1-4*x0*x2-4*x0*x4+ 10*x0*x5+ 5*x1**2-20*x1*x2+ 4*x1*x3-2*x1
*x5+ 26*x2**2-10*x2*x3+ 2*x2*x4+x3**2+x4**2+x5**2-1;
 9*x0**2-6*x0*x5+ 9*x2**2+ 6*x2*x3+x3**2+x4**2+x5**2-1;
 9*x0**2+ 6*x0*x5+ 9*x2**2-6*x2*x3+x3**2+x4**2+x5**2-1;

TITLE : all tangent lines to four given spheres

REFERENCES :

From e-mail correspondence with Cassiano Durand.
(crbd@cs.purdue.edu, http://www.cs.purdue.edu/people/crbd)

Frank Sottile: "From Enumerative Geometry to Solving Systems
  of Polynomial Equations".
In "Computations in Algebraic Geometry with Macaulay 2",
edited by David Eisenbud, Daniel R. Grayson, Michael Stillman,
and Bernd Sturmfels, Volume 8 of Algorithms and Computation
in Mathematics, pages 101-129, Springer-Verlag, 2002.

Frank Sottile and Thorsten Theobald:
"Lines tangents to 2n - 2 spheres in R^n".
Trans. Amer. Math. Soc., 354:4815--4829, 2002.

ROOT COUNTS :

total degree : 64
1-homogeneous Bezout number : 64
  with partition : {x0 x1 x2 x3 x4 x5 }
generalized Bezout number : 64
  based on the set structure :
     {x0 x1 x2 }{x0 x1 x2 }
     {x0 x1 x2 }{x3 x4 x5 }
     {x0 x1 x2 x3 x4 x5 }{x0 x1 x2 x3 x4 x5 }
     {x0 x1 x2 x3 x4 x5 }{x0 x1 x2 x3 x4 x5 }
     {x0 x2 x3 x4 x5 }{x0 x2 x3 x4 x5 }
     {x0 x2 x3 x4 x5 }{x0 x2 x3 x4 x5 }
mixed volume : 64

DESRIPTION : 

The problem is to compute all lines tangent to four unit spheres with
centers (0,-3,0) (0, 3,0) (0, 7,1) and (1,5,2).
In the representation of the line, two vectors are used:
t=(x0,x1,x2) is the tangent vector and m=(x3,x4,x5) is the moment vector,
m = p x t, where p is a point on the line.

For every sphere we have the equation ||m - p_0 x t||^2 = r^2.
where m is the moment vector, p_0 the center of the sphere,
t the tangent vector, and r the radius of the sphere.
This equation follows from the identity (p-p_0) x t = m - p_0 x t,
since m = p x t.
In addition we have m.t=0 and ||t||=1, yielding 6 equation in total.

There are 8 real and 16 complex solutions to this problem.

TIMING on Linux machine :

  ---------------------------------------------------------------------
  |                    TIMING INFORMATION SUMMARY                     |
  ---------------------------------------------------------------------
  |   root counts  |  start system  |  continuation  |   total time   |
  ---------------------------------------------------------------------
  |  0h 0m 0s350ms |  0h 0m 0s 10ms |  0h 9m28s340ms |  0h 9m29s370ms |
  ---------------------------------------------------------------------

THE SOLUTIONS :

24 6
===========================================================================
solution 1 :
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  8.92642184747557E-02   4.69651829607627E-01
 x1 : -1.01549311584344E+00  -3.69829267363464E-03
 x2 :  4.38458291966391E-01  -1.04180249552939E-01
 x3 :  2.95259212765589E+00  -8.35930119558953E-01
 x4 : -2.92091100655319E-02   2.00813433185517E-01
 x5 : -9.13692390848450E-01  -2.74471650834047E+00
== err :  4.173E-14 = rco :  2.219E-03 = res :  2.012E-15 = complex regular ==
solution 2 :
m : 1
the solution for t :
 x0 : -1.25658294383773E-01   1.80753698953145E-48
 x1 : -9.64924008309004E-01  -6.84227765783602E-49
 x2 : -2.30503039549257E-01   2.05268329735081E-48
 x3 :  2.84596539869354E-01   1.91583774419409E-47
 x4 : -1.61771145391678E-01   1.09476442525376E-47
 x5 :  5.22053620151308E-01  -1.09476442525376E-47
== err :  6.609E-16 = rco :  2.683E-02 = res :  1.787E-16 = real regular ==
solution 3 :         start residual :  6.026E-12
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.65253051196845E+01   3.13393183569544E-02
 x1 :  9.76811100897020E-01   4.00585187859149E+00
 x2 :  2.11763377903677E-01  -1.60323698038574E+01
 x3 : -1.97880689371415E+02   4.89367939639559E+01
 x4 :  2.34778772807528E+01   4.81111682131110E+01
 x5 : -4.45758867919396E+01  -1.92689718264418E+02
== err :  6.411E-11 = rco :  3.056E-06 = res :  6.026E-12 = complex regular ==
solution 4 :         start residual :  2.052E-13
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -2.19959736913264E+00   2.35476379807735E+00
 x1 : -1.00799570088806E+00   2.54116692825512E-03
 x2 : -2.35348761328401E+00  -2.20187848504868E+00
 x3 : -1.69983031082462E+01  -2.06959421546751E+01
 x4 : -2.41340383805399E-02  -1.36796277245790E-01
 x5 :  2.07133425730960E+01  -1.69852958994423E+01
== err :  2.373E-12 = rco :  1.693E-04 = res :  2.052E-13 = complex regular ==
solution 5 :         start residual :  1.537E-13
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -2.19959736913263E+00  -2.35476379807738E+00
 x1 : -1.00799570088806E+00  -2.54116692825403E-03
 x2 : -2.35348761328404E+00   2.20187848504867E+00
 x3 : -1.69983031082465E+01   2.06959421546751E+01
 x4 : -2.41340383805018E-02   1.36796277245814E-01
 x5 :  2.07133425730961E+01   1.69852958994427E+01
== err :  1.194E-12 = rco :  1.693E-04 = res :  1.537E-13 = complex regular ==
solution 6 :         start residual :  3.264E-14
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.18340095781885E+00  -1.74127905087492E+00
 x1 : -1.14674889575574E+00  -1.16527026378962E-01
 x2 :  1.64427121071785E+00   1.17195025081551E+00
 x3 :  6.53138429852970E+00   4.69169773943182E+00
 x4 :  8.08022394976113E-01  -1.06273388629499E+00
 x5 : -4.63833767147071E+00   6.16210484094644E+00
== err :  1.299E-13 = rco :  1.479E-03 = res :  3.264E-14 = complex regular ==
solution 7 :         start residual :  1.471E-15
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -8.92642184747546E-02   4.69651829607627E-01
 x1 :  1.01549311584344E+00  -3.69829267363472E-03
 x2 : -4.38458291966390E-01  -1.04180249552938E-01
 x3 : -2.95259212765589E+00  -8.35930119558948E-01
 x4 :  2.92091100655327E-02   2.00813433185518E-01
 x5 :  9.13692390848445E-01  -2.74471650834047E+00
== err :  5.154E-15 = rco :  2.219E-03 = res :  1.471E-15 = complex regular ==
solution 8 :         start residual :  1.492E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.72898246525701E-01  -5.73971850987445E-42
 x1 :  9.83766054710418E-01   4.48415508583941E-43
 x2 :  4.80681385934234E-02   7.17464813734306E-43
 x3 : -7.98736479844875E-01   1.18381694266161E-41
 x4 :  1.51229191630975E-01  -5.02225369614014E-42
 x5 : -2.22059949041180E-01   2.86985925493723E-41
== err :  1.360E-15 = rco :  2.648E-02 = res :  1.492E-16 = real regular ==
solution 9 :         start residual :  2.254E-14
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.18340095781884E+00  -1.74127905087492E+00
 x1 :  1.14674889575574E+00  -1.16527026378961E-01
 x2 : -1.64427121071785E+00   1.17195025081550E+00
 x3 : -6.53138429852970E+00   4.69169773943180E+00
 x4 : -8.08022394976108E-01  -1.06273388629499E+00
 x5 :  4.63833767147069E+00   6.16210484094645E+00
== err :  2.999E-14 = rco :  1.479E-03 = res :  2.254E-14 = complex regular ==
solution 10 :         start residual :  2.758E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  8.41401015983118E-02  -7.00649232162409E-45
 x1 : -9.63487443247169E-01  -1.57646077236542E-45
 x2 : -2.54189673291538E-01   5.60519385729927E-45
 x3 :  1.80338671576343E-01  -1.54142831075730E-44
 x4 :  1.59481439997942E-01   7.00649232162409E-46
 x5 : -5.44808327290400E-01  -2.52233723578467E-44
== err :  4.245E-16 = rco :  2.935E-02 = res :  2.758E-16 = real regular ==
solution 11 :         start residual :  8.754E-12
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.65253051196843E+01  -3.13393183565777E-02
 x1 :  9.76811100896935E-01  -4.00585187859147E+00
 x2 :  2.11763377904046E-01   1.60323698038572E+01
 x3 : -1.97880689371426E+02  -4.89367939639470E+01
 x4 :  2.34778772807514E+01  -4.81111682131141E+01
 x5 : -4.45758867919307E+01   1.92689718264429E+02
== err :  4.630E-11 = rco :  3.056E-06 = res :  8.754E-12 = complex regular ==
solution 12 :         start residual :  2.246E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.96667901539147E-02   6.52530446799852E-55
 x1 :  9.78118051826614E-01   3.33564259232956E-55
 x2 :  2.07119033543398E-01  -1.63132611699963E-54
 x3 :  7.22395663157573E-02   0.00000000000000E+00
 x4 : -1.62550594934833E-01   6.52530446799852E-55
 x5 :  7.60784502291324E-01   1.04404871487976E-53
== err :  4.314E-16 = rco :  3.413E-02 = res :  2.246E-16 = real regular ==
solution 13 :         start residual :  3.443E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.96667901539147E-02  -7.21635307529824E-55
 x1 : -9.78118051826614E-01  -9.78795670199779E-55
 x2 : -2.07119033543398E-01   0.00000000000000E+00
 x3 : -7.22395663157573E-02  -1.04404871487976E-53
 x4 :  1.62550594934833E-01   2.61012178719941E-54
 x5 : -7.60784502291324E-01  -2.61012178719941E-54
== err :  2.427E-16 = rco :  3.413E-02 = res :  3.443E-16 = real regular ==
solution 14 :         start residual :  1.694E-11
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.65253051196846E+01   3.13393183585447E-02
 x1 : -9.76811100897412E-01   4.00585187859137E+00
 x2 : -2.11763377902127E-01  -1.60323698038575E+01
 x3 :  1.97880689371414E+02   4.89367939640010E+01
 x4 : -2.34778772807635E+01   4.81111682131072E+01
 x5 :  4.45758867919835E+01  -1.92689718264418E+02
== err :  1.691E-10 = rco :  3.056E-06 = res :  1.694E-11 = complex regular ==
solution 15 :         start residual :  3.469E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -8.41401015983117E-02   8.40779078594890E-45
 x1 :  9.63487443247169E-01   2.97775923669024E-45
 x2 :  2.54189673291539E-01  -1.12103877145985E-44
 x3 : -1.80338671576342E-01   1.26116861789234E-44
 x4 : -1.59481439997942E-01  -6.65616770554288E-45
 x5 :  5.44808327290400E-01   4.48415508583941E-44
== err :  5.432E-16 = rco :  2.935E-02 = res :  3.469E-16 = real regular ==
solution 16 :         start residual :  1.943E-14
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.18340095781884E+00   1.74127905087492E+00
 x1 : -1.14674889575574E+00   1.16527026378961E-01
 x2 :  1.64427121071785E+00  -1.17195025081550E+00
 x3 :  6.53138429852969E+00  -4.69169773943180E+00
 x4 :  8.08022394976110E-01   1.06273388629499E+00
 x5 : -4.63833767147070E+00  -6.16210484094643E+00
== err :  1.204E-13 = rco :  1.479E-03 = res :  1.943E-14 = complex regular ==
solution 17 :         start residual :  1.388E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.72898246525701E-01  -2.86985925493723E-42
 x1 : -9.83766054710418E-01   3.58732406867153E-43
 x2 : -4.80681385934235E-02   7.17464813734306E-43
 x3 :  7.98736479844875E-01   8.25084535794452E-42
 x4 : -1.51229191630975E-01  -1.43492962746861E-42
 x5 :  2.22059949041181E-01   1.72191555296234E-41
== err :  9.326E-16 = rco :  2.648E-02 = res :  1.388E-16 = real regular ==
solution 18 :         start residual :  2.533E-15
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  8.92642184747549E-02  -4.69651829607626E-01
 x1 : -1.01549311584344E+00   3.69829267363469E-03
 x2 :  4.38458291966390E-01   1.04180249552939E-01
 x3 :  2.95259212765588E+00   8.35930119558949E-01
 x4 : -2.92091100655326E-02  -2.00813433185517E-01
 x5 : -9.13692390848447E-01   2.74471650834047E+00
== err :  8.165E-15 = rco :  2.219E-03 = res :  2.533E-15 = complex regular ==
solution 19 :         start residual :  2.764E-14
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -1.18340095781884E+00   1.74127905087493E+00
 x1 :  1.14674889575574E+00   1.16527026378961E-01
 x2 : -1.64427121071786E+00  -1.17195025081550E+00
 x3 : -6.53138429852971E+00  -4.69169773943182E+00
 x4 : -8.08022394976114E-01   1.06273388629499E+00
 x5 :  4.63833767147071E+00  -6.16210484094646E+00
== err :  3.623E-14 = rco :  1.479E-03 = res :  2.764E-14 = complex regular ==
solution 20 :         start residual :  2.545E-13
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  2.19959736913259E+00   2.35476379807736E+00
 x1 :  1.00799570088806E+00   2.54116692825244E-03
 x2 :  2.35348761328402E+00  -2.20187848504864E+00
 x3 :  1.69983031082463E+01  -2.06959421546746E+01
 x4 :  2.41340383804956E-02  -1.36796277245779E-01
 x5 : -2.07133425730956E+01  -1.69852958994425E+01
== err :  2.408E-12 = rco :  1.693E-04 = res :  2.545E-13 = complex regular ==
solution 21 :         start residual :  2.055E-13
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  2.19959736913267E+00  -2.35476379807737E+00
 x1 :  1.00799570088806E+00  -2.54116692825391E-03
 x2 :  2.35348761328403E+00   2.20187848504872E+00
 x3 :  1.69983031082463E+01   2.06959421546755E+01
 x4 :  2.41340383805099E-02   1.36796277245782E-01
 x5 : -2.07133425730965E+01   1.69852958994424E+01
== err :  1.120E-12 = rco :  1.693E-04 = res :  2.055E-13 = complex regular ==
solution 22 :         start residual :  9.323E-12
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.65253051196847E+01  -3.13393183574669E-02
 x1 : -9.76811100897131E-01  -4.00585187859149E+00
 x2 : -2.11763377903174E-01   1.60323698038576E+01
 x3 :  1.97880689371415E+02  -4.89367939639718E+01
 x4 : -2.34778772807563E+01  -4.81111682131095E+01
 x5 :  4.45758867919552E+01   1.92689718264418E+02
== err :  7.619E-11 = rco :  3.056E-06 = res :  9.323E-12 = complex regular ==
solution 23 :         start residual :  4.059E-16
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 :  1.25658294383773E-01   3.28429327576129E-47
 x1 :  9.64924008309004E-01   1.91583774419409E-47
 x2 :  2.30503039549257E-01  -1.97057596545677E-46
 x3 : -2.84596539869355E-01  -7.00649232162409E-46
 x4 :  1.61771145391678E-01  -5.20013101995538E-47
 x5 : -5.22053620151309E-01   2.73691106313441E-46
== err :  1.060E-15 = rco :  2.683E-02 = res :  4.059E-16 = real regular ==
solution 24 :         start residual :  3.178E-15
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x0 : -8.92642184747550E-02  -4.69651829607627E-01
 x1 :  1.01549311584344E+00   3.69829267363467E-03
 x2 : -4.38458291966391E-01   1.04180249552939E-01
 x3 : -2.95259212765589E+00   8.35930119558950E-01
 x4 :  2.92091100655321E-02  -2.00813433185518E-01
 x5 :  9.13692390848447E-01   2.74471650834047E+00
== err :  8.692E-15 = rco :  2.219E-03 = res :  3.178E-15 = complex regular ==