What formula would find the number of vertices within a 'normal' hexagonal graph, based on its radius (number of hexagons from center to edge)?
I've figured with pseudo code:
for (int i = 0; i < r; i++)
{
vertices += ((r + i) * 2) + 1;
}
vertices = vertices * 2;
Given the graph below, with a radius of 2, the above results in:
([((2 + 0) *2) +1] + [((2 + 1) *2) +1]) *2 = 24
So... Is there a formula that can do this for a radius of n?
Or, given V - F + E = 2, and knowing F = (3* r^2) - (3* r) + 1; a formula to derive the number of edges would work just as well.
Thanks in advance!!