Hexagon inside square - side lengths not adding up properly - what am I not seeing? I am trying to find the side length of a regular hexagon inscribed within a 12"X12" square.  I am not trying to find the maximum side length - I've already seen the formula for that elsewhere - I am trying to find the specific side length where two edges ('east' and 'west', for visualization) are lying on two opposing sides of the square, and the points connecting the other edges ('north' and 'south') are lying in the center of the other two sides of the square.
At first glance, this looks like it should be simple - if I'm working with a regular hexagon, the inner angles should all be 120 degrees.  That, coupled with the shape and positioning, means that the 'trimmed' space in the square ought to consist of four 30-60-90 triangles (30 at the 'north' and 'south' markers, 60 at the 'east' and 'west' markers, and 90 at the corners of the square).  This doesn't seem to compute, though, because the sides of the triangle along the 'north' and 'south' edges should be 6 inches - but by the formula for a 30-60-90 triangle, the length of the square would have to be 4x in size (x for the first short triangle leg, 2x for the edge of the hexagon, which must equal the hypotenuse of the triangle since it's a regular hexagon, and then another x for the short leg of the other triangle).  On a 12" side, this means that x would have to equal three, which blows up the formula for the triangle, as it requires that the x(sqrt(3)) leg be equal in length to the 2x leg.
I'm obviously doing something in my calculations wrong here - where am I thinking incorrectly, and what is the correct answer?
 A: If I've understood the question correctly, the setup is impossible: it assumes that the distances between two opposite vertices of the hexagon, and two opposite sides of the hexagon, are equal to the side length of the square.
Imagining the hexagon inscribed in a circle makes it obvious that opposite vertices are further apart than opposite sides, so the two distances can't be equal.
So what you've got isn't a regular hexagon, and it's refusing to behave like one.
A: For reference, one of the places the "maximum side length" question is asked and answered is in Find the area of the largest hexagon that can be inscribed in a unit square.
One of the implicit steps in that solution is that you measure the "width" and "height" of the hexagon in a frame of reference defined by the square,
so the width is the minimum distance between two parallel lines that enclose the hexagon and are parallel to two sides of the square,
and the height is the minimum distance between two parallel lines that enclose the hexagon and are parallel to the other two sides of the square,
given an angle $\phi$ between a particular diagonal of the hexagon and a particular side of the square.
It may be easier to visualize if you plot everything on a Cartesian coordinate system so that the square parallel to the axes and the hexagon is rotated by some amount.
We can put the vertices of the square at $(\pm 6, \pm 6)$ and the vertices of the hexagon at 
$\left(s\cos\left(\phi + \frac\pi3n\right),
       s\sin\left(\phi + \frac\pi3n\right)\right)$
for some rotation angle $\phi$ and a different integer $n$ for each vertex,
$0 \leq n \leq 5,$ where $s$ is the length of a side of the hexagon
(which is also half the length of a diagonal).
Then the "width" of the hexagon is the difference between its maximum an minimum $x$ coordinates (which always occur at vertices) and the "height" of the hexagon is the difference between its maximum an minimum $y$ coordinates.
If you are visualizing the "north" edge of the square as the edge between 
$(-6,6)$ and $(6,6),$ 
then you are asking for a hexagon with vertices at $(0,6)$ and $(0,-6),$ that is,
$\left(6\cos\left(\frac\pi2\right), 6\sin\left(\frac\pi2\right)\right)$ and
$\left(6\cos\left(\frac{3\pi}2\right), 6\sin\left(\frac{3\pi}2\right)\right)$.
If we set $\phi = \frac\pi6$ these are the vertices for $n = 1$ and $n = 4.$
We can then work out the coordinates of the other four vertices;
the angle $\phi + \frac\pi3n$ takes the values $\frac\pi6,$
$\frac{5\pi}6,$ $\frac{7\pi}6,$ and $\frac{11\pi}6$ when $n = 0, 2, 3, 5,$
and working out the four sets of coordinates we get
$\left(\pm 3\sqrt3, \pm3\right).$
Then the maximum $x$ coordinate of the hexagon is $3\sqrt3 \approx 5.19615,$
the minimum $x$ coordinate is $-3\sqrt3 \approx -5.19615,$
and the width of the hexagon is 
$3\sqrt3 - (-3\sqrt3) = 6\sqrt3 \approx 10.3923.$
The hexagon fits between the "east" and "west" sides of the square without touching either one.
The rotation $\phi = \frac\pi{12}$ and other rotations that yield figures symmetric with that one are the only orientations of the hexagon in which the hexagon can touch all four sides of the square simultaneously,
because those are the only orientations in which the hexagon's width and height are equal.
