User Rating 0.0
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

About

A binary spiral is a fractal structure formed by recursively splitting each node into two children while arranging them radially. At depth d, the tree contains 2d nodes. Each node is placed in polar coordinates at angle θ = θbase + i 2π2d and radius r = r0 + d Δr. Incorrect parameterization leads to overlapping nodes or visual collapse. This tool computes exact polar placements and renders the full tree in real time on an HTML Canvas.

The generator supports up to depth 10 (1024 leaf nodes). Adjusting the angular spread φ below 0.3 rad produces tight spirals. Values above 1.5 rad create open fan structures. Color is mapped per depth level using linear interpolation between two user-defined colors. Animation rotates the global angle offset at a configurable rate. This tool approximates continuous spirals using discrete binary branching. It does not produce Archimedean or logarithmic spirals natively.

binary spiral fractal generator spiral art binary tree generative art spiral creator fractal spiral canvas art

Formulas

Each node in the binary spiral is positioned using polar-to-Cartesian conversion. For a node at depth d with sibling index i (ranging from 0 to 2d 1):

θi,d = θ0 + i 2π2d + d φ + ωt
rd = r0 + d Δr

Cartesian coordinates derived from polar:

x = rd cos(θi,d)
y = rd sin(θi,d)

Color interpolation between start color C0 and end color C1 at depth d with maximum depth D:

C(d) = C0 + dD (C1 C0)

Where θ0 = initial angle offset, φ = angular spread per depth level (controls spiral tightness), ωt = animation rotation offset at time t, r0 = initial radius from center, Δr = radius increment per depth level, D = maximum tree depth.

Reference Data

Depth dTotal NodesLeaf NodesConnectionsVisual Character
1322Simple fork
2746Basic cross
315814Emerging spiral
4311630Clear spiral arms
5633262Dense spiral
612764126Fractal detail visible
7255128254High density pattern
8511256510Complex fractal
910235121022Very dense fractal
10204710242046Maximum complexity
Angular Spread Reference
φ = 0.2 radTight coil, nodes overlap at depth > 6
φ = 0.5 radClassic spiral, good separation
φ = 1.0 radWide spiral arms
φ = 1.5 radFan-like structure
φ = π radSymmetric binary tree (no spiral)
Radius Step Reference
Δr = 10 pxCompact, overlapping at high depth
Δr = 30 pxBalanced spacing
Δr = 50 pxWide rings, needs large canvas
Node Count Formula
Total nodes2d+1 1
Leaf nodes2d
Internal nodes2d 1

Frequently Asked Questions

At depth d, there are 2d nodes sharing the same radius ring. The arc distance between adjacent nodes equals 2π rd2d. When this value drops below twice the node radius, visual overlap occurs. Increase Δr (radius step) or decrease depth to resolve this.
Setting φ = π produces a symmetric binary tree with no spiral character. As φ decreases toward 0, each depth ring rotates relative to its parent, creating the spiral winding effect. Values between 0.3 and 0.8 rad produce the most visually distinct spirals.
Total nodes follow 2d+1 1 and connections equal nodes minus 1. At depth 10, this means 2047 nodes and 2046 line segments. The canvas handles this without performance issues on modern hardware.
Yes. The SVG export reconstructs all nodes and connections as vector elements with exact coordinates. It scales to any resolution without pixelation. PNG export is rasterized at the current canvas dimensions. For print use at 300 DPI, prefer SVG.
Each RGB channel is linearly interpolated between the start color C0 and end color C1. At depth d with max depth D, the interpolation factor is dD. This creates a smooth gradient from root to leaves. Setting both colors identically produces uniform coloring.
Yes. The tool checks the prefers-reduced-motion: reduce media query. When active, animation is disabled by default and the animate toggle is turned off. Users can still manually enable animation if desired.