Visualizations
369 / 500

369 · Illusions

Geometric Illusions

Six classic illusions on graph paper, and a lab that measures how much they fool you.

A notebook of classic geometric illusions, each drawn exactly from its geometry with live parameters: the cafe wall (gray mortar between shifted rows of tiles), Zollner hatching, the Poggendorff bar, Ebbinghaus circles, Muller-Lyer fins and the Fraser spiral, whose concentric rings of twisted cord sit on a log-spiral checkerboard. Measuring uses the method of adjustment with a nulling stimulus: the lab introduces a real counter-distortion from a random starting point (tilted mortar, turned lines, a shifted segment, a bigger circle, a longer shaft) and you adjust it until the figure looks right. Where you stop is the strength of the illusion for you, in degrees, pixels or percent, and the notebook keeps your results. 'Show the truth' overlays red rulers and dimension lines on the real geometry.

Try it. Pick an illusion from the tabs (keys 1 to 6) and drag its sliders, such as the row shift and mortar gray of the cafe wall or the fin angle of the Muller-Lyer. Press 'Measure me' (M), drag across the figure or use the arrow keys until it looks right, then press Done (Enter). T toggles the truth overlay; on the Fraser spiral, click a ring to trace it.

  • Method of adjustment
  • Nulling stimuli
  • Log-spiral patterns
  • Parametric geometry

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a small geometric illusions lab with JavaScript and the HTML canvas element, starting with the cafe wall illusion. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), resizes with the window and looks like paper: a cream background with a faint grid.
- Draw the cafe wall: rows of alternating black and white tiles separated by thin mid-gray mortar lines. Shift every other row sideways by about a quarter to a third of a tile. The perfectly horizontal mortar lines should now look like wedges.
- Add sliders for the row shift, the mortar gray and the mortar width. Notice that black or white mortar makes the illusion disappear.
- Add a 'Show the truth' button that draws red rulers along the mortar lines.

Once that works, add a second illusion and turn it into a measurement:
- Add the Muller-Lyer figure: two equal shafts, one with arrowheads, one with fins pointing outward, and a slider for the fin angle.
- Add a 'Measure me' button: set the lower shaft to a random wrong length, let me drag left and right until the two shafts look equal, then show how far off I was in percent. That number is the strength of the illusion for me.
- Keep a little results table, and use a clean diagram style: ink-black lines, red annotations, small dimension arrows.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as the Ebbinghaus circles, the Poggendorff bar or the Fraser spiral.
PreviousMarble ComputerA wooden pegboard computer where falling marbles count, add and multiply in binary. NextWatercolorPigment rides a shallow-water layer, pools at the edges and granulates on paper.

Related visualizations

  • Lateral InhibitionIllusions Four brightness illusions, each predicted live by a model of retinal ganglion cells.
  • Waterfall IllusionIllusions Stare for twenty seconds, then watch a frozen picture drift the other way.
  • Rotating SnakesIllusions A perfectly still image whose wheels turn wherever you are not looking.
  • Ambiguous ObjectsIllusions Paper tubes that look round on the table and square in the mirror behind them.
  • Anamorphic MirrorIllusions A wildly warped drawing that a chrome cylinder turns back into a picture.
  • Aperture ProblemIllusions One grating, one true motion, three holes that each report a different direction.
  • Hidden 3DIllusions A live magic eye picture: a turning 3D sculpture hidden in colorful noise.
  • Visual CryptographyIllusions Two sheets of pure noise. Slide one over the other and a secret appears.
  • Ames RoomIllusions Identical twins become a giant and a child inside a room that only looks square.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs