Function Repository Resource:

HyperbolicTiling

Source Notebook

Compute polygons for hyperbolic tilings

Contributed by: Arnoud Buzing

ResourceFunction["HyperbolicTiling"][p,q,n]

gives a list of polygons representing the hyperbolic tiling of p,q, and n.

Details and Options

The number of sides for each polygon is given by p.
The number of polygons that meet at each vertex is given by q.
The values for p and q must satisfy (p-2)(q-2)>4.
The number of layers around the center tile is given by n.
ResourceFunction["HyperbolicTiling"] takes a Method option:
"Primal"polygons are positioned around a center coordinate (default)
"Dual"the corresponding dual polygons for the hyperbolic tiling
HyperbolicTiling encapsulates functionality from the hypertiling Python project.

Examples

Basic Examples (3) 

Generate two layers of hyperbolic tiles, where each polygon has four sides and five polygons meet at each vertex:

In[1]:=
tiles = ResourceFunction["HyperbolicTiling"][4, 5, 2]
Out[1]=

Visualize the result:

In[2]:=
Graphics[{EdgeForm[White], FaceForm[Gray], tiles}]
Out[2]=

Generate three layers of seven-sided polygons where three polygons meet at each vertex:

In[3]:=
Graphics[{EdgeForm[White], FaceForm[Gray], ResourceFunction["HyperbolicTiling"][7, 3, 3]}]
Out[3]=

A slightly more complex tiling:

In[4]:=
Graphics[{EdgeForm[White], FaceForm[Gray], ResourceFunction["HyperbolicTiling"][9, 3, 4]}]
Out[4]=

Options (1) 

Compare the "Primal" and "Dual" methods:

In[5]:=
tilesPrimal = ResourceFunction["HyperbolicTiling"][9, 3, 4, Method -> "Primal"]
Out[5]=
In[6]:=
tilesDual = ResourceFunction["HyperbolicTiling"][9, 3, 4, Method -> "Dual"]
Out[6]=
In[7]:=
GraphicsGrid[{{
   Graphics[{EdgeForm[White], FaceForm[Gray], tilesPrimal}],
   Graphics[{EdgeForm[White], FaceForm[Gray], tilesDual}]
   }}]
Out[7]=

Possible Issues

The values for p and q must satisfy (p-2)(q-2)>4. If this is not the case, a Failure object is returned:
In[8]:=
ResourceFunction["HyperbolicTiling"][3, 3, 1]
Out[8]=

Neat Examples (2) 

Get the tiles:

In[9]:=
tiles = ResourceFunction["HyperbolicTiling"][9, 3, 4]
Out[9]=

Get the individual polygons:

In[10]:=
polys = Polygon /@ tiles[[1]];

Animate the incremental drawing of the polygons:

In[11]:=
Manipulate[
 Graphics[
  {EdgeForm[White], FaceForm[Gray], Take[polys, n]}, PlotRange -> 1.2],
 {n, 1, Length[polys], 1}, SaveDefinitions -> True]
Out[11]=

Use the HyperbolicPoincarePolygon resource function to convert the polygons to Poincaré polygons:

In[12]:=
tiles = ResourceFunction["HyperbolicTiling"][5, 4, 4];
In[13]:=
poincare = Map[ResourceFunction["HyperbolicPoincarePolygon"], First@tiles];
In[14]:=
Graphics[{EdgeForm[White], FaceForm[Gray], poincare}]
Out[14]=

Publisher

Arnoud Buzing

Requirements

Wolfram Language 14.0 (January 2024) or above

Version History

  • 1.0.0 – 14 March 2025

Source Metadata

Related Resources

License Information