yvrob
yvrob

Reputation: 105

Calculate efficiently volume intersection between sphere and fine hollow cylinder in Python

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!

Upvotes: 2

Views: 334

Answers (0)

Related Questions