Ratio Visualizer: The Line That Never Closes

Two circles turning at a ratio of 1 : k. Rational ratios close into flowers; irrational ones like π never return to the start.

Ratio k

k = 3.141592654

Closing points

Turns drawn: 0.0

Never closes. It comes closest after:

  • 7 turns ≈ 22/7 · off by 3.2°
  • 106 turns ≈ 333/106 · off by 3.2°
  • 113 turns ≈ 355/113 · off by 0.011°
  • 33,102 turns ≈ 103993/33102 · off by 0.0069°
  • 33,215 turns ≈ 104348/33215 · off by 0.0040°
  • 66,317 turns ≈ 208341/66317 · off by 0.0029°

Drawing

Hear the ratio

3 : 2 sounds like a perfect fifth; π sounds unresolved — like the curve.

How the curve is drawn

Picture an arrow of length 1 spinning around the center once per turn. At its tip, attach a second arrow of the same length that spins k times as fast. The tip of the second arrow traces the curve. In complex numbers that is

z(θ) = e^(iθ) + e^(ikθ)

With k = π this is the curve from the popular “line that never closes” videos. Every value of k gives a different figure, so the same idea works for any number you can think of.

Why irrational numbers never close

The drawing returns to where it started only when both arrows have completed whole turns at the same time: q turns of the first and p turns of the second. That means k = p/q, a fraction. Rational ratios therefore close into a finite flower; irrational ratios such as π, e, √2 and φ never do. Over time their curves wind around endlessly and fill the whole ring between radius 0 and 2 — which is what gives them their mandala-like look.

π’s near misses

Although π never closes, it comes very close whenever it is near a simple fraction. Those fractions are the convergents of π’s continued fraction:

TurnsFractionMisses closing by
722/73.2° of a turn
106333/1063.2° of a turn
113355/1130.011° of a turn
33,102103,993/33,1020.0069° of a turn

So after 7 turns you see an almost-closed figure with 15 lobes, which then slowly drifts. After 113 turns it misses by only about a hundredth of a degree — 355/113, found by the Chinese mathematician Zu Chongzhi in the 5th century, is accurate to six decimal places. Use +100 turns in the tool to jump there.

Rational ratios and symmetry

For a fraction k = p/q in lowest terms, the curve closes after q turns and has exactly |p − q|-fold rotational symmetry. 22/7 gives a 15-fold flower; 5/4 closes after 4 turns but has no rotational symmetry at all (|5 − 4| = 1); 355/113 gives a 242-fold figure so fine it looks like π itself. Try entering your own fractions as decimals, such as 0.5, 2.5 or −1.5 (negative values spin the second arrow backwards).

From ratios to sound

Musical intervals are frequency ratios. Press Play both tones to hear the current ratio: 3 : 2 is a perfect fifth, 5 : 4 a major third, and both draw closed, stable shapes. π and other irrational ratios sound restless because the two tones never line up — the audible version of a line that never closes. The same idea, with two perpendicular vibrations instead of circles, gives the Lissajous figures in the Chladni simulator, and the difference between nearby tunings is explored in 432 Hz vs 440 Hz.

Want the full story of π’s approximations and why the golden ratio is the “most irrational” number? Read Why π Never Closes.

Frequently asked questions

Why does the π curve never close?

The curve returns to its start only when both circles complete whole numbers of turns at the same moment, which requires the speed ratio to be a fraction p/q. π is irrational, so that never happens — the line keeps filling the disk forever.

What is the formula behind the pi mandala?

z(θ) = e^(iθ) + e^(iπθ). In plain terms: one arrow rotates once per turn, a second arrow attached to its tip rotates π times as fast, and the tip of the second arrow draws the curve.

Why does the curve almost close after 7 turns?

Because π ≈ 22/7. After 7 turns of the first circle the second has made about 21.99 turns — just short of 22 — so the curve nearly meets its start. The next near miss is at 113 turns, since π ≈ 355/113.

Which number fills the circle most evenly?

The golden ratio φ. Its continued fraction is all 1s, which makes it the irrational number that is hardest to approximate with fractions, so its curve avoids near-closures and spreads out most evenly.

How is this related to sound?

Treat the two circles as two tones. A 3 : 2 ratio is a perfect fifth and draws a closed shape; an irrational ratio never repeats, just as the two tones never line up. This is the circular cousin of Lissajous figures and harmonographs.