## Baskets of polygons

### Baskets

Fix two integers `m ≥ 3`

and `n ≥ 4`

and consider, in the horizontal plane
in three-space, a regular `m`

-gon surrounded by `m`

regular `n`

-gons
with the same side length, glued to it edge to edge.

Depending on `m`

and `n`

, the outer `n`

-gons can

- overlap with their neighbours (think of
`m`

and `n`

both large) - tile perfectly, that is, intersect with each of their neighbours along an edge
- leave out some space, so that two neighbouring
`n`

-gons
only share a vertex

The second case happens only for finitely many pairs `(m, n)`

and is well studied.

The third case happens for every `(m, 4)`

and for finitely many other pairs.

In that third case, if we rotate each `n`

-gon by a same angle around
its common edge with the central `m`

-gon, as the rotation angle
increases, the gap between neighbouring `n`

-gons decreases,
until for some special value `alpha`

(depending on `m`

and `n`

),
it vanishes and each `n`

-gon shares a full edge with each of its neighbours.

We obtain a "basket" ; let's call that an `(m, n)`

-basket.

### Link with the soccer ball polyhedron

The soccer ball polyhedron is the polyhedron made
of 12 regular pentagons and 20 regular hexagons,
all with the same side length, glued edge to edge,
each pentagon adjacent to 5 hexagons, each hexagon
adjacent to 3 pentagons and 3 hexagons.

One of the pentagons together with its five adjacent hexagons
form a `(5, 6)`

-basket.

### Basket angle

The question is: for each `m`

and `n`

, what is the angle `alpha`

to use?

### Modelisation and solution

To determine the angle `alpha`

, we restrict our attention
to one `m`

-gon and one adjacent `n`

-gon.

For convenience we take half the side length as our length unit.

We set up some notation. Call

`M`

the `m`

-gon, `E`

its centre, `N`

the `n`

-gon, `T`

, `U`

, `V`

, `W`

four consecutive vertices of `N`

,
such that `[UV]`

is the common edge with `M`

`A`

the midpoint of `[UV]`

`C`

the midpoint of `[TW]`

`P`

the plane that contains `M`

`L`

the line through `E`

perpendicular to `P`

`p`

the orthogonal projection map from the whole space to `P`

(parallel to `L`

) `B = p(C)`

the orthogonal projection of `C`

to `P`

`tau`

the angle of a full turn, that is, `tau = 2*pi`

`r`

the rotation map by `tau/m`

(an `m`

-th of a turn) around `L`

sending `U`

to `V`

and `T`

to `W`

; - for each integer
`k`

, `r^k`

the rotation by `(k/m)*tau`

around `L`

,
(the `k`

-th composition power of `r`

),

Notice the rotates `r^k(T)`

for `k`

from `0`

to `m - 1`

(including `T`

and `W`

) form a regular `m`

-gon parallel to `M`

.

Call `R`

that `m`

-gon, and `F`

its centre. Notice that `p(F) = E`

.

Since the planes containing `M`

and `R`

are parallel,
`p`

induces an isometry between them, so `FC = EB`

(both as vectors and as lengths).

Notice `E`

, `A`

, `B`

are aligned, so, as lengths, `EB = EA + AB`

### Right-angled triangles, and a trapezoid

We notice some right-angled triangles:

`(A, B, C)`

has a right angle at `B`

and an angle `alpha`

at `A`

, so

```
cos(alpha) = AB / AC
```

(if `n = 4`

that triangle is degenerate but the formula still holds)

`(E, A, V)`

has a right angle at `A`

and an angle `pi/m`

at `E`

, so

```
tan(pi/m) = AV / EA
cot(pi/m) = EA / AV
```

and notice that by our choice of length unit, `AV = 1`

`(F, C, W)`

has a right angle at `C`

and an angle `pi/m`

at `F`

, so

```
tan(pi/m) = CW / FC
cot(pi/m) = FC / CW
```

Furthermore, calling `H`

the orthogonal projection of `U`

to the line `(TW)`

,

`(T, H, U)`

has a right angle at `H`

and an angle `tau/n`

at `T`

, so

```
TH = 2 * cos(tau/n)
UH = 2 * sin(tau/n)
```

In the trapezoid `(T, U, V, W)`

, `C`

is the midpoint of `[WT]`

,
the points `C`

, `H`

, `T`

are aligned, and `UACH`

is a rectangle, so

```
CW = CT
CT = CH + HT
AC = UH = 2 * sin(tau/n)
CH = AU = 1
```

### Combining our equations

Starting from the equation

```
FC = cot(pi/m) * CW
```

and substituting

```
FC = EB = EA + AB = cot(pi/m) + 2 * sin(tau/n) * cos(alpha)
```

and

```
CW = CT = CH + HT = AU + TH = 1 + 2 * cos(tau/n)
```

we get

```
cot(pi/m) + 2 * sin(tau/n) * cos(alpha) = cot(pi/m) * (1 + 2 * cos(tau/n))
```

which simplifies to

```
2 * sin(tau/n) * cos(alpha) = cot(pi/m) * 2 * cos(tau/n)
```

and gives

```
cos(alpha) = cot(pi/m) * cot(tau/n)
```

### How can Sage be useful here?

Define a function and try it out:

```
def basket_angle(m, n):
return arccos(cot(pi/m) * cot(2*pi/n))
```

Pentagon surrounded by hexagons:

```
sage: a = basket_angle(5, 6)
sage: a
arccos(1/15*sqrt(3)*sqrt(10*sqrt(5) + 25))
sage: a.n()
0.652358139784368
sage: (a/pi).n()
0.207652045225832
sage: (a * 180 / pi).n()
37.3773681406497
```

Triangle surrounded by octagons:

```
sage: a = basket_angle(3, 8)
sage: a.n()
0.955316618124509
```

In degrees:

```
sage: (a * 180 / pi).n()
54.7356103172453
```

### Going further

It would be a fun project to draw pictures and animations
to illustrate the problem using Sage. For example, one could
produce

a 3d animated scene to illustrate folding the hexagons
from an initial position spread out in the plane of the
pentagon to a final folded up position

a 3d animated scene drawing each of the steps of the
reasoning above, highlighting the relevant right angled
triangles one after the other.