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):
The curvature is too large to assume that the intersection is between two planes. The three cases are the following:
- The sphere intersects the hollow cylinder from the inside.
- The sphere intersects the hollow cylinder from the inside.
- 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!