# Number of equilateral triangles in triangular grid covered by a circle with radius 1

Here's a problem I saw:

How many equilateral triangles (with length $1$ cm) on a triangle grid can be covered with a circle centered at a point with radius $r$ cm?

At first I thought the answer is just $r^2\times 6$, but then I found out it's only for small $r$.

For example:

Here the grey part is the answer, but then if the circle gets bigger, the orange part might cover some triangles, which makes the answer different.

Can anyone help me with it? I want a formula for at least $1\leq r\leq 100000$. Thanks.

• This is just Gauss' circle problem for $\mathbb{Z}[\omega]$. For large radii the maximum number of triangles should be close to $$\frac{\pi r^2}{\frac{\sqrt{3}}{4}} = \frac{4\pi}{\sqrt{3}} r^2$$ minus a $O(r)$ (probably a $O(r^{2/3})$) term. Jul 6 '17 at 3:30
• en.wikipedia.org/wiki/Gauss_circle_problem Jul 6 '17 at 3:31
• But is there an explicit formula for the problem? I really need the exact value though... :( @JackD'Aurizio Jul 6 '17 at 3:37
• Each triangle is root (3)/2 high so you can stack 2r/root(3) triangles perpendicular to the diameter and 2r an Lang the diameter. Roughly. Jul 6 '17 at 3:39
• math.stackexchange.com/questions/1411295/… Jul 6 '17 at 3:42

To find the number of triangles in the orange part, we first determine how many levels $L$ of triangles it can contain. In the figure below is an example where $r=9$ and $L=1$:

The number of levels is just the number of times the height of a triangle $h=\frac {\sqrt 3}{2}$ fits into the distance $|AB|$ and since $|AB|=r-d = r- \frac {\sqrt 3}{2}r$, we get:

$$L=\left \lfloor \frac{|AB|}{h} \right \rfloor =\left \lfloor \frac{2-\sqrt 3}{\sqrt 3}r \right \rfloor$$ With $r=9$ we see that $L=1$. To find the number of triangles in each level, we need to find the length of the chord that delimits that level. In the figure above the chord that delimits the first (and only) level is shown in green. The length of a chord is given by: $$c=2\sqrt{r^2-d_O^2}$$ where $d_O$ is the distance from the chord to the circle center $O$. So for a given level $k \le L$ we would have a chord length of $$c_k = 2\sqrt{r^2-(d+k\cdot h)^2}$$ So how do we determine the number of triangles $t_k$ in a level, given the chord length? It depends on which way the middle triangle of the level is pointing. If it's pointing away from the center circle (as in the figure above) we have

$$t_k = \begin{cases} 1, & c_k \lt 2 \\ 5, & 2 \le c_k \lt 4 \\ 9, & 4 \le c_k \lt 6 \\ \text{etc} \end{cases}$$

and if it's pointing toward the circle center we have

$$t_k = \begin{cases} 0, & c_k \lt 1 \\ 3, & 1 \le c_k \lt 3 \\ 7, & 3 \le c_k \lt 5 \\ \text{etc} \end{cases}$$

The pattern for calculating $t_k$ in each case, should be clear.

The first level "points away" if $r$ is odd and "points towards" if $r$ is even. Subsequent levels of course alternate between the two. Below is a figure with $r=18$ and hence $L=2$:

We see that the first level points towards the circle center.

So, to sum up:

1. Determine the number of levels

2. Sum the number of triangles in each level

3. Add this sum to $r^2$

4. Multiply this number by $6$.

I made a program in Visual Basic which does the job in some $30$ lines of code.

• Thanks so much for helping! :D Jul 14 '17 at 10:27
• My pleasure. :-)
– Jens
Jul 14 '17 at 11:54