2

I have an infinite hollow cylinder which intersects spheres. I would like to calculate the volume of the intersection of a sphere in each of the cases shown here (view from above):

enter image description here

The curvature is too large to assume that the intersection is between two planes. The three cases are the following:

  1. The sphere intersects the hollow cylinder from the inside.
  2. The sphere intersects the hollow cylinder from the inside.
  3. The sphere intersects the hollow cylinder from the both sides.

Is there any formula, library or method in Python I could find to do that efficiently? Indeed, this calculation should be done 1-10 millions of times.

Thank you!

yvrob
  • 105
  • 10
  • 1
    I’m voting to close this question because it is not about programming. – High Performance Mark Jul 20 '22 at 15:48
  • 1
    Thank you for your comment. It actually is part of an algorithm to calculate the radial packing fraction of spheres in a cylinder. I will then edit my question to make it clear. – yvrob Jul 20 '22 at 16:00
  • is the cylinder infinitely elongated? – Cadeyrn Jul 21 '22 at 13:19
  • another question: is the radius of the sphere always smaller than the two radii of the cylinder? – Cadeyrn Jul 21 '22 at 14:01
  • Thank you for your questions. The cylinder is indeed infinite in the z direction. Then, spheres can be entirely contained within the hollow cylinder. – yvrob Jul 22 '22 at 07:52

0 Answers0