Calculate volume of hollow tilted cylinder inside cube, without a grid
问题 I have a hollow cylinder with inner radius r1 and outer radius r2. This cylinder is tilted from the Z axis towards the X axis, then rotated around the Z axis and then translated along X and along Y. I also have a cube between a range of X and Y values. I then want to calculate how large a volume of the hollow cylinder is inside the cube. %set variables r1 = 0.9; r2 = 1.0; z1 =-1.0; z2 = 1.0; beta = pi/4; gamma = pi/8; %create inner surface [X,Y,Z] = cylinder(r1, 100); %outer surface [Xx,Yy,Zz