def calculate_polygons(startx, starty, endx, endy, radius):
    import math
    
    # Hexagon dimensions
    width = math.sqrt(3) * radius  # flat-to-flat width for pointy-top hexagons... 
    # Actually let's use flat-top hexagons
    # For flat-top hexagon:
    # width (tip to tip) = 2 * radius
    # height (flat to flat) = sqrt(3) * radius
    # horizontal spacing = 1.5 * radius (center to center)
    # vertical spacing = sqrt(3) * radius (center to center)
    
    col_width = 1.5 * radius
    row_height = math.sqrt(3) * radius
    
    polygons = []
    
    col = 0
    x = startx
    while x < endx:
        row = 0
        # Odd columns are offset vertically
        y_offset = (row_height / 2) if col % 2 == 1 else 0
        y = starty + y_offset
        while y < endy:
            # Calculate the 6 vertices of the flat-top hexagon centered at (x, y)
            hexagon = []
            for i in range(6):
                angle_deg = 60 * i
                angle_rad = math.pi / 180 * angle_deg
                px = x + radius * math.cos(angle_rad)
                py = y + radius * math.sin(angle_rad)
                hexagon.append((px, py))
            polygons.append(hexagon)
            y += row_height
            row += 1
        x += col_width
        col += 1
    
    return polygons