In Islamic culture, geometry is everywhere. You can find it in mosques, madrasas, palaces and private homes. This tradition began in the 8th century CE during the early history of Islam, when craftsmen took preexisting motifs from Roman and Persian cultures and developed them into new forms of visual expression.

This period of history was a golden age of Islamic culture, during which many achievements of previous civilizations were preserved and further developed, resulting in fundamental advancements in scientific study and mathematics. Accompanying this was an increasingly sophisticated use of abstraction and complex geometry in Islamic art, from intricate floral motifs adorning carpets and textiles, to patterns of tile work that seemed to repeat infinitely, inspiring wonder and contemplation of eternal order.

Despite the remarkable complexity of these designs, they can be created with just a compass to draw circles and a ruler to make lines within them, and from these simple tools emerges a kaleidoscopic multiplicity of patterns. So how does that work? Well, everything starts with a circle. The first major decision is how will you divide it up? Most patterns split the circle into four, five or six equal sections. And each division gives rise to distinctive patterns.

There’s an easy way to determine whether any pattern is based on fourfold, fivefold, or sixfold symmetry. Most contain stars surrounded by petal shapes. Counting the number of rays on a starburst, or the number of petals around it, tells us what category the pattern falls into. A star with six rays, or surrounded by six petals, belongs in the sixfold category. One with eight petals is part of the fourfold category, and so on.

There’s another secret ingredient in these designs: an underlying grid. Invisible, but essential to every pattern, the grid helps determine the scale of the composition before work begins, keeps the pattern accurate, and facilitates the invention of incredible new patterns. Let’s look at an example of how these elements come together.

We’ll start with a circle within a square, and divide it into eight equal parts. We can then draw a pair of criss-crossing lines and overlay them with another two. These lines are called construction lines, and by choosing a set of their segments, we’ll form the basis of our repeating pattern.

Many different designs are possible from the same construction lines just by picking different segments. And the full pattern finally emerges when we create a grid with many repetitions of this one tile in a process called tessellation.

By choosing a different set of construction lines, we might have created this any of the above patterns. The possibilities are virtually endless.

We can follow the same steps to create sixfold patterns by drawing construction lines over a circle divided into six parts, and then tessellating it, we can make something like the above.

Here’s another sixfold pattern that has appeared across the centuries and all over the Islamic world, including Marrakesh, Agra, Konya and the Alhambra.

Fourfold patterns fit in a square grid, and sixfold patterns in a hexagonal grid.

Fivefold patterns, however, are more challenging to tessellate because pentagons don’t neatly fill a surface, so instead of just creating a pattern in a pentagon, other shapes have to be added to make something that is repeatable, resulting in patterns that may seem confoundingly complex, but are still relatively simple to create.

This more than 1,000-year-old tradition has wielded basic geometry to produce works that are intricate, decorative and pleasing to the eye. And these craftsmen prove just how much is possible with some artistic intuition, creativity, dedication along with a great compass and ruler.