CylinderConeCircumscribedSphere::usage="Find the equation of a cylinder whose direction of the generatrix is {1, 2, 3} and is circumscribed around the sphere with center C{0, 0, 0} and radius r = 2. Also obtain the cone with vertex {1, 2, 3} circumscribed to the same sphere.Reference: Personal. ";
Cylinder
Method 1:
Parametric equations of the generatrix:
{x,y,z}={a,b,c}+t{1,2,3};
Substituting in the equation of the sphere:
In[]:=
Expand[++==4]
2
(a+t)
2
(b+2t)
2
(c+3t)
2
a
2
b
2
c
2
t
14+(2a+4b+6c)t+++-4==0;
2
t
2
a
2
b
2
c
Considering the condition of tangency between the cylinder and the sphere (discriminant is equal to zero):
In[]:=
Expand[-56(++-4)==0]
2
(2a+4b+6c)
2
a
2
b
2
c
224-52+16ab-40+24ac+48bc-200;
2
a
2
b
2
c
The point {a, b, c} is on the cylinder, then the equation of the cylinder is:
13+10+5-4xy-6xz-12yz-56==0;
2
x
2
y
2
z
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 (also of the cylinder axis) and r is the radius of the cylinder (sphere).
In[]:=
2==
Norm[{1,2,3}({x,y,z}-{0,0,0})]
Norm[{1,2,3}]
In[]:=
2++;Expand[56==++]
2
Abs[-2x+y]
2
Abs[3x-z]
2
Abs[-3y+2z]
14
2
(-2x+y)
2
(3x-z)
2
(-3y+2z)
5613-4xy+10-6xz-12yz+5;13+10+5-4xy-6xz-12yz-56==0;
2
x
2
y
2
z
2
x
2
y
2
z
Cone:
Method 1:
Symmetrical equations of the generatrix:
x-1
a
y-2
b
z-3
c
Substituting in the equation of the sphere:
Expand[++==4]
2
(1+at)
2
(2+bt)
2
(3+ct)
14+6ct++2at+4bt++4;(++)+(6c+2a+4b)t+10==0;
2
c
2
t
2
a
2
t
2
b
2
t
2
a
2
b
2
c
2
t
Considering the condition of tangency between the cylinder and the sphere (discriminant is equal to zero):
In[]:=
Expand[-40(++)==0]
2
(2a+4b+6c)
2
a
2
b
2
c
-36+16ab-24+24ac+48bc-40;
2
a
2
b
2
c
Then the equation of the cone is (see symmetrical equations of the generatrix):
In[]:=
Expand[9+6+-4(x-1)(y-2)-6(x-1)(z-3)-12(y-2)(z-3)==0]
2
(x-1)
2
(y-2)
2
(z-3)
-56+8x+9+16y-4xy+6+24z-6xz-12yz+0;9+6+-4xy-6xz-12yz+8x+16y+24z-56==0;
2
x
2
y
2
z
2
x
2
y
2
z
Method 2:
By the definition of a straight circular cone, where Q is a point on the axis of the cone, it can be the center of the sphere, P is any point on the cone, V is the vertex of the cone. The angle is the one formed by the generatrix and the axis:
Cos[θ]==;
(P-v).(Q-V)
P-VQ-V
Since the sphere is tangent to the cone, the radius is the opposite cathetus of the angle and the hypotenuse would be the distance from the center of the sphere to the vertex:
In[]:=
Hypotenuse=Norm[{1,2,3}-{0,0,0}]
14
;By Pythagoras:
In[]:=
Adjacentcathetus==
14-4
Adjacentcathetus
10
;In[]:=
10
14
({x,y,z}-{1,2,3}).({0,0,0}-{1,2,3})
Norm[{x,y,z}-{1,2,3}]Norm[{0,0,0}-{1,2,3}]
In[]:=
5
7
1-x-2(-2+y)-3(-3+z)
14
2
Abs[-1+x]
2
Abs[-2+y]
2
Abs[-3+z]
2
(-1+x)
2
(-2+y)
2
(-3+z)
2
(1-x-2(-2+y)-3(-3+z))
980-140x+70-280y+70-420z+701372-196x+7-392y+28xy+28-588z+42xz+84yz+63;9+6+-4xy-6xz-12yz+8x+16y+24z-56==0;
2
x
2
y
2
z
2
x
2
y
2
z
2
x
2
y
2
z
To create the animation of the cylinder:
Plane that cuts to the sphere passing through its center:
x+2y+3z==0;
The plane intersects the sphere resulting in the circumference:
In[]:=
x=-2y-3z;y=u;z=v;{-2,1,0}{1,2,3}
{3,6,-5};
In[]:=
{0,0,0}+{-2,1,0}+{3,6,-5}
2Cos[θ]
Norm[{-2,1,0}]
2Sin[θ]
Norm[{3,6,-5}]
-+3Sin[θ],+6Sin[θ],-Sin[θ];
4Cos[θ]
5
2
35
2Cos[θ]
5
2
35
10
7
In[]:=
ManipulateCent={0,0,0};ContactPoint[t_]:=-+3Sin[t],+6Sin[t],-Sin[t];Show[{ParametricPlot3D[ContactPoint[t1]+t{1,2,3},{t,-2,2},PlotStyle->{Black,Thick}],Table[ParametricPlot3D[ContactPoint[k]+t{1,2,3},{t,-2,2},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,2],Black,Ball[ContactPoint[t1],0.1]}]},AxesLabel->(Style[#,15,Blue]&/@{"X","Y","Z"}),AxesOrigin{0,0,0},AxesTrue,BoxedFalse,BoxRatiosAutomatic,PlotRange7,ViewPoint{1.3,-2.4,5.},ImageSize700],Style["Cylinder:",Bold,Large],{{t1,0.00002,"Value (t1)"},0.00001,2π,0.00001},ControlPlacementTop
4Cos[t]
5
2
35
2Cos[t]
5
2
35
10
7
Out[]=
To create the animation of the cone:
To obtain the circumference that will be the cone directrix:
A point will be found on the circumference when :
The point is:
The axis of the cone passes through the points C{0, 0, 0} and V{1, 2, 3}, then:
Plane that cuts to the sphere passing through the point P:
Using polar coordinates (to obtain the intersection circumference of the plane and the sphere):

