We have a hexagonal board (see drawing) with a face length D
We have three dimensions (directions): red, blue and green
We have line numbers in three directions (specific values are not critical, they can be any)
It is necessary to make a map of the dependencies of the line number in the dimension, the position of the cell in this line for each cell of the entire board.
That is, for number 1, you need to get data in three dimensions: 1:(1,0), 2:(7,0), 3:(1,0)
similarly to the example for the number 21 : 1:(3,5), 2:(6,3), 3:(10,3)(3,5) for example means line 3, cell 5.
For red measurement, everything is quite simple:
S = K * D + N + summ(range(1,K-1)) - 2*summ(range(1,KD)) Where
- K - line number
- D is the size of the board (smaller face)
- N - the number of cells in the line
- range is a function that returns a range, and if the left border is greater than the right, then it returns 0
- S - cell number for the entire board
I can not figure out how to calculate the other two dimensions?
