Imagine looking at a cylinder side-on. Now cut off a "corner" of the cylinder from the top such that there is still some flat surface on the top. How do you calculate the volume of the bit you cut off, as a function of the cylinder radius r, cut angle theta (where 0 is horizontal), and cut position x (some position across the top of the cylinder)?