1

I want to create a hexagonal lattice but it should be centered basically the whole lattice is a central hexagon and then layers of hexagon around, like shown in the figure. (may be my description is confusion, but right now that is how I am seeing it).

So I want to generate the coordinates for lattice below. I found many algorithm to create square lattice of hexagons but I want to ask if there is a algorithm for following lattice too.

enter image description here

0

1 Answer 1

1

Note:

N-th layer consists of 6N cells.

First cell of that layer in your representation has coordinate shift

(N*A*Sqrt(3)/2, N*A*3/2), where A is edge length.

First cell of that layer has number

2+3*N*(N-1)                     //(you have missed 14)  

You can start from the first cell of Nth layer, make N more cells to left, N cells to left-down and so on...

Sign up to request clarification or add additional context in comments.

2 Comments

Hey @MBo, thanks for the reply. but I am confused. what do you mean by First cell of that layer . Also by First cell of that layer? I am quite confused by the description. Would appreciate it if you can elaborate a bit on this?
Cell number 2 is the first cell of the first layer (it contains cells 2..7), Cell number 8 is the first cell in the second layer (8..19).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.