how to calculate octagon sides
Then the hypotenuse of each of those triangles is x*sqrt(2). But that hypotenuse is one of the sides of the octagon, so each side of the octagon has length x*sqrt(2) You are calling the diameter of the octagon the distance from side to side; this is the same as the length of the side of the original square.