# Volume of 4 intersecting cylinders

### Volume of 4 intersecting cylinders

Hello.Can you please help me find an expression for the volume of the left body which is actually 4 cylinders with diameter = D placed on the vertices of the cube with side length L (the cylinders are being "cut" by the corners of the cube). Thank you!
Attachments
20180406_042255.jpg (113.65 KiB) Viewed 171 times
Guest

### Re: Volume of 4 intersecting cylinders

Is that a homework or you really need to calculate this volume.

Finding analytical expression is possible but tedious. If you just need the volume, draw this figure in some 3D software like Solidworks, NX or Autocad and measure it.

Otherwise, I can suggest an interesting approach using the Monte Carlo method:

Iteratevly generate random points $(x, y, z)$ inside the cube $x \le a, y \le a and z \le a$. Check the distance to either of the diagonals. If it is less than the radius of the cylinder, then count it as "in", otherwise count it as "out". After sufficient number of iterations you wil get the ratio of the volume of the solid to the cube $k = \frac{in}{in + out}$.

I can post a short procedure in Python or JavaScript and you can run it on some of the many online Python/JS interpreters.
Guest