Volume of an octagonal dome I need a way to find the volume of an octagonal dome. Can someone help me with the formula for that?
Here's an example of the object I am trying to analyze 

 A: This is a classic volume by cross-section problem. The general idea goes as follows: We are given a reasonably simple, bounded solid figure $S$ living in $xyz$-space. Note that a specified value of the variable $z$ determines a horizontal plane that intersects the solid for some range of $z$ values, say $z=a$ to $z=b$. If we can find a formula $A(z)$ that tells us the the area $A$ of the cross-section corresponding to $z$, then the desired volume is
$$\int_a^b A(z) \ dz.$$
Let us apply this to find the volume of a dome whose base is a regular $n$ sided polygon of radius $R$, that has $n$ vertical cross-sections that are semi-circles, and such that all its horizontal cross-sections are again regular $n$ sided polygons. Such a figure for $n=6$ looks like so:

Again, the base is a regular $n$ sided polygon with radius $R$ and all the other horizontal cross-sections are regular $n$ sided polygons with smaller radius. Radius in this context, means the distance from the center to one of the vertices. On octagon with radius $x$ is shown in the figure below on the left. Now, can make a crucial observation by looking at this figure from the side and perpendicular to one of the circles, as shown in the figure below on the right. We then see that $x$ is related to the cross-sectional height $z$ by $x^2 = R^2-z^2$.

Furthermore, a little elementary geometry (or a reference to this webpage) shows that the area of a regular $n$ sided polygon of radius $x$ is
$$A(x) = \frac{1}{2}nx^2\sin(2\pi/n).$$
Thus, as a function of $z$, we get
$$A(z) = \frac{1}{2}n(R^2-z^2)\sin(2\pi/n).$$
Finally, the volume of the solid is
$$V = \frac{1}{2}n\sin(2\pi/n)\int_0^R (R^2-z^2) \ dz = \frac{1}{3}nR^3\sin(2\pi/n).$$
When the base is an octagon and the radius unspecified (as in your problem), we get volume of $4\sqrt{2}R^3/3$.
