hex_utils/hasc.py
def getCellVertexes(self, i, j):
        """
         Edge coordinates of an hexagon centered in (x,y) having a side of d:
        
                   [x-d/2, y+sqrt(3)*d/2]   [x+d/2, y+sqrt(3)*d/2] 
        
          [x-d, y]                                                 [x+d, y]
        
                   [x-d/2, y-sqrt(3)*d/2]   [x+d/2, y-sqrt(3)*d/2]
        """
        
        # Using unrotated centroid coordinates to avoid an extra computation
        x,y = self._getUnrotatedCellCentroidCoords(i, j)
        
        return [
            self.rotatePoint(x - self._side,       y                 ),  
            self.rotatePoint(x - self._side / 2.0, y - self._hexPerp ), 
            self.rotatePoint(x + self._side / 2.0, y - self._hexPerp ), 
            self.rotatePoint(x + self._side,       y                 ),                 
            self.rotatePoint(x + self._side / 2.0, y + self._hexPerp ),
            self.rotatePoint(x - self._side / 2.0, y + self._hexPerp ), 
            ]
def getCellVertexes(self, i, j):
        """
         Edge coordinates of an hexagon centered in (x,y) having a side of d:
        
                   [x-d/2, y+sqrt(3)*d/2]   [x+d/2, y+sqrt(3)*d/2] 
        
          [x-d, y]                                                 [x+d, y]
        
                   [x-d/2, y-sqrt(3)*d/2]   [x+d/2, y-sqrt(3)*d/2]
        """
        
        # Using unrotated centroid coordinates to avoid an extra computation
        x,y = self._getUnrotatedCellCentroidCoords(i, j)
        
        return [
            self.rotatePoint(x - self._side,       y                 ),  
            self.rotatePoint(x - self._side / 2.0, y - self._hexPerp ), 
            self.rotatePoint(x + self._side / 2.0, y - self._hexPerp ), 
            self.rotatePoint(x + self._side,       y                 ),                 
            self.rotatePoint(x + self._side / 2.0, y + self._hexPerp ),
            self.rotatePoint(x - self._side / 2.0, y + self._hexPerp ), 
            ]
Edge coordinates of an hexagon centered in (x,y) having a side of d:
        
                   [x-d/2, y+sqrt(3)*d/2]   [x+d/2, y+sqrt(3)*d/2] 
        
          [x-d, y]                                                 [x+d, y]
        
                   [x-d/2, y-sqrt(3)*d/2]   [x+d/2, y-sqrt(3)*d/2]