Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute polygons for hyperbolic tilings
| ResourceFunction["HyperbolicTiling"][p,q,n] gives a list of polygons representing the hyperbolic tiling of p,q, and n. | 
| "Primal" | polygons are positioned around a center coordinate (default) | 
| "Dual" | the corresponding dual polygons for the hyperbolic tiling | 
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]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/0ead196fcea5f9d9.png) | 
| Out[1]= |  | 
Visualize the result:
| In[2]:= | ![Graphics[{EdgeForm[White], FaceForm[Gray], tiles}]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/09c00a18460da290.png) | 
| 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]}]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/26a2d77087e6f68b.png) | 
| Out[3]= |  | 
A slightly more complex tiling:
| In[4]:= | ![Graphics[{EdgeForm[White], FaceForm[Gray], ResourceFunction["HyperbolicTiling"][9, 3, 4]}]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/140f11cc7f2cc24f.png) | 
| Out[4]= |  | 
Compare the "Primal" and "Dual" methods:
| In[5]:= | ![tilesPrimal = ResourceFunction["HyperbolicTiling"][9, 3, 4, Method -> "Primal"]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/1f6f18690c347c30.png) | 
| Out[5]= |  | 
| In[6]:= | ![tilesDual = ResourceFunction["HyperbolicTiling"][9, 3, 4, Method -> "Dual"]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/2e7d05e7d29f13b6.png) | 
| Out[6]= |  | 
| In[7]:= | ![GraphicsGrid[{{
   Graphics[{EdgeForm[White], FaceForm[Gray], tilesPrimal}],
   Graphics[{EdgeForm[White], FaceForm[Gray], tilesDual}]
   }}]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/50827da03067aa96.png) | 
| Out[7]= |  | 
| In[8]:= | ![ResourceFunction["HyperbolicTiling"][3, 3, 1]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/6010014deaffd09b.png) | 
| Out[8]= |  | 
Get the tiles:
| In[9]:= | ![tiles = ResourceFunction["HyperbolicTiling"][9, 3, 4]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/650d1778193e80b1.png) | 
| Out[9]= |  | 
Get the individual polygons:
| In[10]:= | ![polys = Polygon /@ tiles[[1]];](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/50e74ccf13199197.png) | 
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]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/482f9d5c868a0123.png) | 
| Out[11]= |  | 
Use the HyperbolicPoincarePolygon resource function to convert the polygons to Poincaré polygons:
| In[12]:= | ![tiles = ResourceFunction["HyperbolicTiling"][5, 4, 4];](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/6c56c7b179d9301c.png) | 
| In[13]:= | ![poincare = Map[ResourceFunction["HyperbolicPoincarePolygon"], First@tiles];](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/7a5908900b0e730d.png) | 
| In[14]:= | ![Graphics[{EdgeForm[White], FaceForm[Gray], poincare}]](https://www.wolframcloud.com/obj/resourcesystem/images/a39/a3982f86-9de2-435a-8347-7bba0f0beec7/12e430fa9b08d022.png) | 
| Out[14]= |  | 
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License