title: Algorithm for creating cells by spiral on the hexagonal field
body: <p>Help to find an algorithm for creating cells by spiral on the hexagonal field.</p>
  
  <p>Look at the image:</p>
  
  <p><a href="https://i.stack.imgur.com/Npl2u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Npl2u.png" alt="alt text"></a>
  </p>
  
  <p>Let's imagine  an dimensionless 2d array.
  The X axis is the blue line, Y is horizontal, spiral is red.</p>
  
  <p>I need to add cells from the central point x0y0 to point N by spiral</p>
  
  <p>Tell me the way to solve the problem, please.
  Thank you!</p>