Originally Posted by DivideBy0
in this case you have to use a little bit trigonometrie:
let s be the length of one side of the octagon.
Then you deal with 8 isosceles triangle with the base s, the two legs r and the angle at the vertex (that is the center of the circle) is 45°.
Now divide one isoscele triangle into 2 right triangles:
The hypotenuse is r and one leg is ½s, the angle opposite of this leg is 22.5°.
Now you can calculate r:
The longest diagonal D = 2r
----- = sin(22.5°) ==> r = ----------
Let d be the shortest diagonal. Then ½d is the height in one of the isoscele triangles:
Now you can calculate ½d:
By the way: This last equation is exactly the same as the one I've posted in my previous post.
----- = sin(45°) ==> r = ----------