How to obtain the volume of the intersection of two caps of the same sphere

3 views (last 30 days)
Dear All,
At the moment I am working on the intersection of spheres with a cube (size sphere << size cube). I want to obtain the total volume of the speres inside the box. You can have the following situations: 1) The sphere does not intersect with any of the cube boundaries 2) The sphere intersects with one of the cube boundaries 3) The sphere intersects with two of the boundaries 4) The sphere intersects with three of the boundaries
I have a problem with case 3 and 4. I do not know how to obtain the volume that lies inside the cube. For example with the two boundary intersection case: two caps need to be cut off, but these caps may intersect with eachother. When you just cut off both caps this overlapping part will be subtracted twice leaving you with a too small volume.
How can I obtain the volume of this cap intersectional part? How should I perform the integral in Matlab? And over which function? And with which bounds?
(by the way: I already looked at spherequad but I do not know how to implement it in an integral, and it doesn't seem to give the volume by itself)
Thank you very much in advance!
Kind regards,
M

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!