IFS Encyclopedia

Contributing a New Entry

Each entry in the encyclopedia is a single .mdx file in src/content/ifs/. To add a new fractal, fork the repository, create the file, and open a pull request.

1. Choose a slug

The filename (without .mdx) becomes the URL path: /ifs/your-slug. Use lowercase letters, digits, and hyphens only. Examples: gosper-island, twin-dragon, ammann-beenker.

2. Frontmatter fields

Every entry starts with a YAML frontmatter block between --- delimiters.

Required fields

FieldTypeDescription
namestringHuman-readable display name. Shown in the catalog, page title, and search results.
descriptionstringOne sentence. Used in <meta description> and the search index.
transformsintegerNumber of affine maps in the IFS (positive integer).
tagsarraySee the tag list below. At minimum include a dimension tag (plane or 3d).
aifsliteral block stringAIFS program that renders the fractal. See §3 below.

Optional fields

FieldTypeDescription
cardDescriptionstringShort text shown on the catalog card. Falls back to description if omitted.
dimensionstringHausdorff dimension as a display string, e.g. "log(3)/log(2) ≈ 1.585" or "2".
boundaryDimensionstringHausdorff dimension of the boundary ∂A, e.g. "≈ 1.5236", "1 (polyhedral)", or "0 (point contacts)".
referencesarrayList of {text, url?} objects. Include original papers, Wikipedia, and Tilings Encyclopedia links where available.

Complete frontmatter example

---
name: "Gosper Island"
description: "Self-similar 2D fractal tile associated with the polynomial x²−5x+7."
cardDescription: "Seven self-similar maps with hexagonal algebra."
dimension: "2"
transforms: 7
boundaryDimension: "≈ 1.1292"
tags: [plane, self-similar, tiling, algebraic]
aifs: |
  @
  $dim=2
  $subspace=[s,0]
  s=[0,-1,1,1]
  g=[3,1,-1,2]
  h0=s^2*[1,0]
  h1=s^5*[0,-1]
  h2=s^2*[-1,0]
  h3=1
  h4=[0,-1]
  h5=s^2*[0,-1]
  h6=s*[1,0]
  A=g^-1*(h0|h1|h2|h3|h4|h5|h6)*A
references:
  - text: "Mandelbrot, B. B. (1982). The Fractal Geometry of Nature."
  - text: "Gosper island — Wikipedia"
    url: "https://en.wikipedia.org/wiki/Gosper_island"
---

3. Writing the AIFS program

The aifs field contains an AIFS program — the language used by IFStile and the in-browser renderer. Use a YAML literal block scalar (the | character after the field name), then indent the program by two spaces.

Minimal 2D IFS (Sierpiński triangle)

aifs: |
  @
  $dim=2
  f1=[0.5,0,0,0.5]
  f2=[0.5,0]*[0.5,0,0,0.5]
  f3=[0.25,0.5]*[0.5,0,0,0.5]
  S=(f1|f2|f3)*S

Algebraic IFS via companion matrix (Heighway dragon)

aifs: |
  @
  $dim=2
  s=$companion([1,0])   # s satisfies s²+1=0, i.e. s ↔ i
  g=s+1                 # expansion: 1+i
  A=(s*g^-1|[1,0]*s^2*g^-1)*A

$companion([a0,a1,...,an-1]) builds the companion matrix for xn + an−1xn−1 + … + a0. Use $subspace=[s,0] to project onto the first eigenplane of s when the IFS lives in a higher-dimensional rational space.

GIFS — multiple tile types (Robinson triangles)

When the tiling has several prototile shapes, each gets its own attractor variable and equation. Add the gifs tag.

aifs: |
  @
  $dim=4
  $subspace=[s,0]
  s=$companion([1,0,0,0])    # 8th cyclotomic, s↔e^(iπ/4)
  ...
  A1=g^-1*(h0*A1|h1*A2)
  A2=g^-1*(h2*A1|h3*A2|h4*A2)

To render a specific attractor set, add $root=A1 inside the block, or pass a root prop to <IFSCanvas>.

Verify in IFStile

Paste the AIFS program into app.ifstile.com before submitting. The attractor should render without errors. Common mistakes:

4. Tags

Use tags from the table below. Combine freely; order does not matter.

TagMeaning
planeLives in 2D (Euclidean plane). Mutually exclusive with 3d.
3dThree-dimensional fractal.
self-similarThe standard IFS attractor equation A = ⋃ fᵢ(A).
gifsGeneralized IFS — multiple interleaved attractor sets (e.g. GIFS tilings).
tilingThe attractor tiles the plane (or space) by copies of itself.
rep-tileThe tile is a rep-tile: it can be dissected into smaller similar copies.
curveThe attractor is a fractal curve (1D Hausdorff, plane-filling or not).
algebraicDefined via a companion matrix or arithmetic in an algebraic number field.
aperiodic-tilingThe tiling is aperiodic (no translational periodicity).
quasicrystalHas long-range quasicrystalline order (5-, 7-, 8-, 10-, 12-fold symmetry).
limit-periodicLimit-periodic tiling (chair, sphinx, etc.).
p-adicRelated to p-adic structure or hierarchical substitution.
pentagonal5-fold symmetry (pentadendrite, pentigree, Robinson triangles …).
hexagonal6-fold symmetry (sphinx, Koch snowflake …).
dendriteFractal dendrite (star-shaped, tree-like boundary).
classicHistorically well-known entry found in most fractal textbooks.
probabilisticRandom IFS (maps chosen with probabilities, e.g. Barnsley fern).
naturalisticResembles a natural object (plant, landscape, …).

5. Writing the Markdown body

After the closing ---, write freely in Markdown. A typical structure:

  1. Overview — one paragraph describing what the fractal is and why it is interesting.
  2. Definition — the maps in matrix/vector form using LaTeX math.
  3. Properties — dimension, symmetry, algebraic structure.
  4. Boundary Dimension (optional) — if you computed it.
  5. References — the references frontmatter field is rendered automatically at the bottom.

Math syntax

Canvas (fractal preview)

For a single attractor the canvas is rendered automatically from the aifs frontmatter field — nothing extra needed.

Multiple variants on one page (family / gallery)

If your entry showcases a family of related fractals (like the Square Family), put each variant in its own export const AIFS string in the MDX body, then place as many <IFSCanvas> elements as you need. The aifs frontmatter field should hold the most representative or canonical variant — it is used for the catalog card thumbnail.

import IFSCanvas from '../../components/IFSCanvas.astro';

export const aifsVariantA = `@
$dim=2
...
A=...`;

export const aifsVariantB = `@
$dim=2
...
A=...`;

<div class="canvas-row">
  <figure>
    <IFSCanvas id="my-slug-a" aifs={aifsVariantA} width={280} height={280} label="Variant A" />
    <figcaption>Variant A</figcaption>
  </figure>
  <figure>
    <IFSCanvas id="my-slug-b" aifs={aifsVariantB} width={280} height={280} label="Variant B" />
    <figcaption>Variant B</figcaption>
  </figure>
</div>

GIFS — multiple tile types in one AIFS

When a single AIFS program has multiple interleaved attractor sets (e.g. two triangle types in Robinson triangles), render each with a separate canvas pointing at the same AIFS string but a different root:

import IFSCanvas from '../../components/IFSCanvas.astro';

export const myAifs = `@
$dim=4
...
A1=g^-1*(h0*A1|h1*A2)
A2=g^-1*(h2*A1|h3*A2)`;

<div class="canvas-row">
  <figure>
    <IFSCanvas id="my-slug-a1" aifs={myAifs} root="A1" width={380} height={380} label="Tile A1" />
    <figcaption>Tile $A_1$</figcaption>
  </figure>
  <figure>
    <IFSCanvas id="my-slug-a2" aifs={myAifs} root="A2" width={380} height={380} label="Tile A2" />
    <figcaption>Tile $A_2$</figcaption>
  </figure>
</div>

Zoomed fragment canvas

To highlight a specific region of the fractal (e.g. a magnified boundary detail), pass a camera prop to <IFSCanvas>. For 2D, it is an array [cx, cy, r, angle_deg]: center coordinates, inscribed-circle radius, and rotation angle (use 0 for no rotation).

The easiest way to find the coordinates is to open the attractor in app.ifstile.com, zoom and pan to the desired view, then copy the camera values from the IFStile UI.

The AIFS string for a zoomed canvas is the same as the main entry — do not embed $camera inside the AIFS itself; pass it as a prop instead so the canvas and the "Open in IFStile" link both work correctly.

import IFSCanvas from '../../components/IFSCanvas.astro';

export const aifsMain = `@
$dim=2
...
A=...`;

<!-- zoomed view of a boundary region -->
<IFSCanvas
  id="my-slug-zoom"
  aifs={aifsMain}
  width={480} height={480}
  label="My Fractal — zoomed boundary"
  camera={[0.554, 0.872, 0.006, 0]}
/>

A width/height of 480 works well for zoomed canvases. Reuse the same export const AIFS string — no need to duplicate it.

6. Submit a pull request

  1. Fork github.com/ifsdb/ifsdb.github.io.
  2. Create a branch: git checkout -b add/your-slug.
  3. Add your file at src/content/ifs/your-slug.mdx.
  4. Open a pull request with a short description of the entry.

Once the PR is merged, the main repository's CI builds and deploys the site automatically. No local setup is required.

To verify your file builds without errors before opening a PR, install Node.js 18+ and run:

npm install
npx astro build

For a live preview with hot reload, use npx astro dev instead — the dev server opens at http://127.0.0.1:4321. See the Astro installation guide for full details.

If you are unsure about the AIFS program or the mathematical details, open an issue first and we can help refine it before the full PR.