Math reference

For the curious. Each design is a layered composition of well-known parametric forms, replicated through a rotational symmetry group. This page walks through the math.

1. The symmetry frame

Every design is rendered through a k-fold rotational symmetry. A single set of strokes is drawn k times, each rotated by 2π/k radians around the canvas center.

If a primitive layer draws point (x, y), the design draws the orbit of that point under the symmetry group:

{ (x·cos(iθ) − y·sin(iθ),  x·sin(iθ) + y·cos(iθ))  :  i = 0, 1, …, k−1 }

with θ = 2π/k. The fold count k is the Symmetry slider in Geometry → Shape; valid values are 1–24.

When Bilateral Mirror is on, each rotated copy is also reflected across the y-axis, doubling the orbit and producing dihedral group Dk. Without the mirror it's the cyclic group Ck.

Useful intuitions:

  • k = 6 is the natural fold for the Flower of Life (six circles around one).
  • k = 8 produces the classic ⊕ rosette common in Islamic geometry.
  • k = 9 is the Sri Yantra fold — three groups of three triangles.
  • k = 12 is "as ornate as the eye still parses" — many Rose Window patterns.
  • k = 1 with mirror on is just bilateral reflection — useful for "scroll" or "vine" compositions.

2. The layer catalog

Sacred Spin ships nineteen geometry layers; sixteen are live in v1.0 and three are pending. Each layer is a parametric form rendered through the symmetry frame above.

LayerMathKey parameters
CirclesConcentric circles ri = R · (i/N)pcircles
PolygonsRegular n-gons or n-pointed stars on rotating basespolyLayers, polySides, polyStar
RadialsLines from center to radius R at angle 2π·i/Nradials
Orbit dotsPoints equispaced on circles of radius rjorbitDots
Intersection dotsMarker dots placed at each polygon vertexintDots
Center dotSingle dot at origincenterDot
Flower of LifeSix circles arranged hexagonally around a center circle, recursed n rings outflowerRings
Vesica PiscisPair of circles offset by r; the lens-shaped intersection has ratio √3 : 1vesicaCount
SpirographHypotrochoid (see below)spiroPetals, spiroLoops
Log Spiralr(θ) = a · e with b ≈ ln(φ) / (π/2) for the golden spirallogSpiralOn, logSpiralA
Lissajousx = A sin(at + δ), y = B sin(bt) with frequency ratio a:blissajousA, lissajousB, lissajousDelta
Platonic projectionOrthographic 2-D projection of a Platonic solid's edge graphplatoOn, platoSolid
Crescent moonsDifference between two offset circles of slightly different radiicrescentOn, crescentPhase
Eye / Vesica EyeVesica with an inner pupil circle and quadratic-Bezier eyelidseyeOn
Vine mirrorRecursive L-system-like growth seeded by a deterministic PRNGvineOn, vineDepth, vineSeed
Sri YantraNine interlocking triangles around a central bindu, with lotus rings + bhupura gatesriYantraOn, sriYantraScale

Hypotrochoid (spirograph)

The classic Spirograph toy traces the path of a fixed point inside a small circle (radius r, centered offset d from circumference) as that small circle rolls inside a larger circle (radius R):

x(t) = (R − r) cos t + d cos((R − r)/r · t)
y(t) = (R − r) sin t − d sin((R − r)/r · t)

When R/r is rational (say p/q in lowest terms), the curve closes after q revolutions of the outer circle, producing a p-petal rosette. Sacred Spin parameterizes this as Petals (p) and Loops (q); ranges are tuned so the result always closes within a small handful of revolutions.

Sri Yantra — the constraint

The Sri Yantra's nine-triangle construction is famously under-specified by the standard description: "four upward and five downward triangles intersect at points that should align." Most published yantras are mathematically inconsistent — vertices don't actually meet where the diagram suggests. Achieving a correct Sri Yantra requires solving a nonlinear system of constraints; the classical solution gives a unique arrangement up to scale.

Sacred Spin uses Kulaichev's 1984 numerical solution: the triangles' vertex coordinates are precomputed so all 14 marma intersection points land exactly. The Sri Yantra Scale slider isotropically scales the whole figure; the bhupura gate scales with it.

Logarithmic spiral and the golden ratio

A spiral satisfies the equiangular property — every radius cuts the curve at the same angle — when:

r(θ) = a · e^(bθ)

The "golden spiral" is the special case where the spiral grows by a factor of φ ≈ 1.618 each quarter-turn:

b = ln(φ) / (π / 2) ≈ 0.30635

In Sacred Spin the Log Spiral layer defaults near this value. Setting b to other values shifts toward Fibonacci-style spirals (slower) or "tornado" spirals (faster).

3. Color

Two color modes:

  • Single mode: all strokes share one base color, optionally hue-shifted by stroke depth.
  • Palette mode: strokes cycle through an ordered palette as a function of layer index. The 20 built-in palettes are organized by harmony (analogous, complementary, triadic, tetradic).

Background is independent and chosen from a small set (black, deep blue, gradient).

4. Animation

Time enters the design through one channel: the base rotation of the symmetry frame, which advances at 6° per second. Spirograph and Vine Mirror layers also evolve their own internal t, but at a tempo locked to that same base rate so the whole composition turns in unison.

Pinch and drag are immediate — they don't animate; they overwrite the current rotation/scale and decay back to the baseline animation.

5. Reproducibility

Every design Sacred Spin can produce is encoded by a single recipe — a small JSON document (~2 KB) listing every parameter. Two devices loading the same recipe render bit-for-bit identical pixels (modulo display resolution). The combinatorial space, given the slider ranges and step sizes used in the iOS app, contains roughly 106+ distinct designs surfaced; the desktop edition exposes the full ~1012 space.

6. References

  • Lawlor, R. Sacred Geometry: Philosophy and Practice (Thames & Hudson, 1982).
  • Olsen, S. The Geometry of the Flower of Life (Wooden Books, 2009).
  • Kulaichev, A. P. "Sriyantra and its mathematical properties." Indian Journal of History of Science, 19(3), 1984.
  • Lindenmayer, A. "Mathematical models for cellular interaction in development." J. Theoretical Biology, 18 (1968).
  • Lissajous, J. A. "Mémoire sur l'étude optique des mouvements vibratoires." Annales de Chimie et de Physique, 51 (1857).
  • Wolfram MathWorld, Hypotrochoid: mathworld.wolfram.com/Hypotrochoid.html
  • Critchlow, K. Islamic Patterns: An Analytical and Cosmological Approach (Thames & Hudson, 1976).