This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def calculate_polygons(startx, starty, endx, endy, radius): | |
""" | |
Calculate a grid of hexagon coordinates of the given radius | |
given lower-left and upper-right coordinates | |
Returns a list of lists containing 6 tuples of x, y point coordinates | |
These can be used to construct valid regular hexagonal polygons | |