3
$\begingroup$

In a cube of side "a", a sphere with center in one of the vertices intersects another sphere located in the vertex opposite to the previous one. What is the volume of the intersection?

First I tried to draw the situation The equation of one of the spheres centered at the origin is

$$x^2+y^2+z^2 =a^2$$ And the one located on the opposite vertex will be

$$(x-a)^2+(y-a)^2+(z-a)^2 =a^2$$

2 questions How to plot the situation? How to calculate the common volume?

I used several commands but I did not get the cube and the 2 spheres at the same time in a drawing

Thanks in advance

Edited: There was an error in the radios of the spheres, they have radius "a", similar to the edges of the cube

$\endgroup$
  • $\begingroup$ Try this: RegionIntersection[Ball[{0, 0, 0}, 3], Ball[{1, 1, 1}, 3]] // Volume $\endgroup$ – Anjan Kumar Apr 22 '17 at 1:12
  • $\begingroup$ "Unable to compute the volume of region \ RegionIntersection[Ball[{0,0,0},3],Ball[{1,1,1},3]]" :( $\endgroup$ – susy diaz Apr 22 '17 at 1:38
  • $\begingroup$ Note that your problem statement mentions nothing about the radius. Are you sure that's all you've been given? $\endgroup$ – J. M. is away Apr 22 '17 at 1:51
  • $\begingroup$ Edited: There was an error in the radios of the spheres, they have radius "a", similar to the edges of the cube $\endgroup$ – susy diaz Apr 22 '17 at 2:11
  • $\begingroup$ c = {1, 1, 1}; Show[ContourPlot3D[{(x - 1)^2 + (y - 1)^2 + (z - 1)^2 == 1, x^2 + y^2 + z^2 == 1}, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, ContourStyle -> Opacity[0.5], Mesh -> None], Graphics3D[{Red, PointSize[0.04], Point[{{0, 0, 0}, c}], Line[{{0, 0, 0}, c}]}]] --> This is the idea Similar code in forum As I get the whole spheres, and the volume $\endgroup$ – susy diaz Apr 22 '17 at 2:49
4
$\begingroup$

For the plotting - with a equal to 1:

Graphics3D[{Opacity[0.3], Green, Ball[], Red, Ball[{1, 1, 1}], 
  Opacity[0.6], Blue, Cuboid[]}]

enter image description here

As suggested by J.M., it is possible to derive a symbolic expression for the region using

region = Simplify[RegionMember[RegionIntersection[
    Ball[], Ball[{1, 1, 1}]], {x, y, z}], {x, y, z} ∈ Reals]

x^2 + y^2 + z^2 <= 1 && (-1 + x)^2 + (-1 + y)^2 + (-1 + z)^2 <= 1

which is the same as the OPs expression with a=1.

To plot just the intersection:

RegionPlot3D[region, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, PlotPoints -> 100]

enter image description here

To find the volume, integrate over the region of intersection:

NIntegrate[Boole[region], {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]

0.107742
$\endgroup$
  • $\begingroup$ ok , What instruction do I now take to calculate the common volume of the two spheres $\endgroup$ – susy diaz Apr 22 '17 at 21:05
  • 1
    $\begingroup$ Here's the symbolic way to get the integration region: Simplify[RegionMember[RegionIntersection[Ball[], Ball[{1, 1, 1}]], {x, y, z}], {x, y, z} ∈ Reals] $\endgroup$ – J. M. is away Apr 23 '17 at 2:30
  • $\begingroup$ Hey what if I want to find intersection region of two ellipsoid instead? $\endgroup$ – Rajat Zope Mar 8 '18 at 11:18
  • $\begingroup$ @Rajat Zope -- Define the region and then integrate over Boole[region]. $\endgroup$ – bill s Mar 8 '18 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.