CylinderCircumscribedSphere::usage="Find the equation of a cylinder whose direction of the generatrix is {1, 1, 1} and is circumscribed around the sphere with center C{-2, 4, 5} and radius r = 4. Reference: Personal. ";
Method 1:
Parametric equations of the generatrix:
{x,y,z}={a,b,c}+t{1,1,1};
Substituting in the equation of the sphere:
In[]:=
​​Expand[
2
(a+t+2)
+
2
(b+t-4)
+
2
(c+t-5)
==16]
Out[]=
45+4a+
2
a
-8b+
2
b
-10c+
2
c
-14t+2at+2bt+2ct+3
2
t
16
3
2
t
+(2a+2b+2c-14)t+29+4a+
2
a
-8b+
2
b
-10c+
2
c
==0;
Considering the condition of tangency between the cylinder and the sphere (discriminant is equal to zero):
In[]:=
Expand[
2
(2a+2b+2c-14)
-12(29+4a+
2
a
-8b+
2
b
-10c+
2
c
)==0]
-152-104a-8
2
a
+40b+8ab-8
2
b
+64c+8ac+8bc-8
2
c
0;
The point {a, b, c} is on the cylinder, then the equation of the cylinder is:
-19-13x-
2
x
+5y+xy-
2
y
+8z+xz+yz-
2
z
==0;​​
2
x
+
2
y
+
2
z
-xy-xz-yz+13x-5y-8z+19==0;
Method 2:
Equation of the cylinder (by the definition of the straight circular cylinder):
r=
A({x,y,z}-{h,k,l})
A
;
Where {x, y, z} is any point on the cylinder, {h, k, l} it is a point on the axis of the cylinder, it can be the center of the sphere, A is the director vector of the generatrix and r is the radius of the cylinder (sphere).
In[]:=
4==
Norm[{1,1,1}({x,y,z}-{-2,4,5})]
Norm[{1,1,1}]
In[]:=
4
2
Abs[-6-x+y]
+
2
Abs[7+x-z]
+
2
Abs[-1-y+z]
3
;​​Expand[48==
2
(-6-x+y)
+
2
(7+x-z)
+
2
(-1-y+z)
]
4886+26x+2
2
x
-10y-2xy+2
2
y
-16z-2xz-2yz+2
2
z
;​​
2
x
+
2
y
+
2
z
-xy-xz-yz+13x-5y-8z+19==0;
To create the animation:
Plane that cuts to the sphere passing through its center:
x+y+z+D==0;​​-2+4+5+D=0;​​D=-7;​​x+y+z-7==0;
The plane intersects the sphere resulting in the circumference:
In[]:=
x=-y-z+7;​​y=u;​​z=v;​​{-1,1,0}{1,1,1}
In[]:=
{1,1,-2};​​{-2,4,5}+
4Cos[θ]
Norm[{-1,1,0}]
{-1,1,0}+
4Sin[θ]
Norm[{1,1,-2}]
{1,1,-2}
-2-2
2
Cos[θ]+2
2
3
Sin[θ],4+2
2
Cos[θ]+2
2
3
Sin[θ],5-4
2
3
Sin[θ];
In[]:=
​​ManipulateCent={-2,4,5};​​ContactPoint[t_]:=-2-2
2
Cos[t]+2
2
3
Sin[t],4+2
2
Cos[t]+2
2
3
Sin[t],5-4
2
3
Sin[t];​​Show[{ParametricPlot3D[ContactPoint[t1]+t{1,1,1},{t,-8,8},PlotStyle->{Black,Thick}],​​Table[ParametricPlot3D[ContactPoint[k]+t{1,1,1},{t,-8,8},PlotStyle->{Opacity[0.2],Green},PerformanceGoal->"Speed"],{k,0,t1,0.1}],​​ParametricPlot3D[ContactPoint[u],{u,0,t1},PlotStyle->{Blue,Thick}],Graphics3D[{Red,Specularity[White,40],Sphere[Cent,4],Black,Ball[ContactPoint[t1],0.3]}]},​​AxesLabel->(Style[#,15,Blue]&/@{"X","Y","Z"}),AxesOrigin{0,0,0},AxesTrue,BoxedFalse,BoxRatiosAutomatic,PlotRange15,ViewPoint{-3,3,-10},ImageSize700],Style["Cylinder:",Bold,Large],{{t1,0.00002,"Value (t1)"},0.00001,2π,0.00001},ControlPlacementTop
Out[]=
​
Cylinder:
Value (t1)