Hi Martin.
I'll assume that we'll talk about outside dimensions throughout. Let me draw a diagram to get us started:
Now x is the length we are trying to determine. I'll draw a geometric model that will help us do the mathematics:
The bottom length is the same as the width of the octagon (30 inches). That means that 30 = x + y + y which you can rearrange as y = (30  x)/2.
The Pythagorean theorem tells us that the square of the hypotenuse of a right triangle equals the sum of the squares of the two legs. In our diagram, that means x^{2 } = y^{2 } + y^{2 }. If we substitute our expression for y from above, we get this:
Now we have to rearrange this so that we can figure out the value of x.
This gives us a quadratic equation we can't easily factor, so we'll use the Quadratic Formula to find the value of x:
Which reduces to:
Now, obviously, that piece of wood won't be 72.4 inches long! But the other length, 12.43 inches is just what we want for the 30 inch octagon. In fact, if you you work it out,
so if want a "formula" for your carpentry for other sizes of octagons, use this:
x = 0.4142w
where w is the outside width of your octagon.
Hope this helps!
Stephen La Rocque.
