# Formula for points on hexagonal structure

This topic is 3388 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I have the following hexagonal structure, which is created around a central point (color orange): (The structure in the picture is a bit irregular, but it should be a regular grid.) Now I want to get the coordinates of vertices, e.g. all vertices that are located on the thick circle. Is there a generic way to get all vertex coordinates on a specific circle around the center? Regards,

##### Share on other sites
You could pick all the vertices within X "hops" from the center. In your picture choosing all vertices with 3 hops from the center gives you all the vertices on the circle, plus a few others.

##### Share on other sites
If you are having trouble with the trigonometry, you have 3 types of hoops:
- East, which corresponds to the vector (1,0)
- Northwest, which corresponds to the vector (-1/2, sqrt(3)/2)
- Southwest, which corresponds to the vector (-1/2, -sqrt(3)/2)

Now moving through your grid can be done by starting at (0,0) and then doing a sequence of alternatingly adding and subtracting one of those three values.

Another way of generating all the points in the grid is to consider all the points with coordinates (a + b/2, b*sqrt(3)/2), where a and b are integers such that (a-b+1) is not a multiple of 3.

[Edited by - alvaro on June 10, 2009 8:31:16 PM]

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
18
5. 5

• 33
• 13
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
632565
• Total Posts
3007106

×