What do you exactly want to achieve? The term "hexagon rect" doesn't make any sense, these are two distinct shapes.
Have a look at trigonometry and basic vector algebra, after that computing the coordinates of hexagons is not difficult. But it will require you some time to read through those topics, you can't just ask here and expect an answer "that's how it works". If you don't know where to look, Wikipedia is a good start.