VolumeBetweenTwoSpheres::usage="Find the volume of the solid that is inside the spheres: + + + 4x - 2y + 4z + 5 = 0 y + + = 4. References: eodelgadocursos.wordpress.com, 12.1, prob.- 40; Personal ";
2
x
2
y
2
z
2
x
2
y
2
z
In[]:=
Show[{ContourPlot3D[4x-2y+4z+9==0,{x,-6,6},{y,-6,6},{z,-6,6},ContourStyleDirective[Yellow,Opacity[0.2],Specularity[White,30]],MeshNone],ParametricPlot3D[{2Cos[u]Sin[v]-2,2Sin[u]Sin[v]+1,2Cos[v]-2},{u,0,2π},{v,0,2π},MeshNone,PerformanceGoal"Quality",PlotStyleDirective[Green,Opacity[0.2],Specularity[White,20]]],ParametricPlot3D[{2Cos[u]Sin[v],2Sin[u]Sin[v],2Cos[v]},{u,0,2π},{v,0,2π},MeshNone,PerformanceGoal"Quality",PlotStyleDirective[Orange,Opacity[0.2],Specularity[White,20]]]},AxesLabel->(Style[#,15,Blue]&/@{"X","Y","Z"}),AxesOrigin{0,0,0},AxesTrue,BoxedFalse,PlotRangeAll,BoxRatiosAutomatic,ImageSize700,PerformanceGoal"Quality"]
Out[]=
Distance from center to center:
In[]:=
d=++
2
(0+2)
2
(0-1)
2
(0+2)
Out[]=
3
If the circles were externally tangent, their distance would be 4, which means that h = 0.5.The height of a cap is h. If a is the radius of the cap and r the radius of the sphere:
2
(r-h)
2
a
2
r
2
a
2
h
The volume of a sphere cap is (by the disk method:
h
∫
0
2
a
In[]:=
h
∫
0
2
h
Out[]=
-π+πr
3
h
3
2
h
V
c
π
2
h
3
In[]:=
V
c
π
2
(0.5)
3
Out[]=
1.4399
But since there are 2 caps, the volume of the solid between the two spheres is:
In[]:=
2*1.4398966328953218
Out[]=
2.87979