title: How to draw/manage a hexagon grid?
body: <p>I've read this article: <a href="https://stackoverflow.com/questions/5972797/generating-creating-hexagon-grid-in-c">generating/creating hexagon grid in C</a> . But look like both the author and answerer have already abandoned it.</p>
  
  <p><code>√(hexagonSide - hexagonWidth * hexagonWidth)</code>: What's hexagonSide and hexagonWidth? Isn't it will &lt; 0 (so square root can't be calculated).</p>
  
  <p>And, can I put a hexagon into a rectangle? I need to create a grid like this:</p>
  
  <p><img src="https://i.stack.imgur.com/r9c1Z.png" alt="Source:Wikipedia"></p>
  
  <p>One more thing, how can I arrange my array to store data, as well as get which cells are next to one cell?</p>
  
  <p>I have never been taught about hexagon, so I know nothing about it, but I can easily learn new thing, so if you can explain or give me a clue,  I may do it myself.</p>