Contents

Contents

The Circle Illusion: Between Geometry and Visual Perception

Contents

This article explores how an arrangement of squares can form a rotating circular illusion using LaTeX and TikZ. We will examine the structure of the code, the visual principles behind the illusion, and its significance in perception and visual art.


In the world of visual perception, optical illusions are fascinating phenomena that reveal how the human brain interprets visual information. One such illusion is the circle illusion, where simple geometric patterns can create the impression of motion or form that does not actually exist. This article explores how an arrangement of squares can form a rotating circular illusion using LaTeX and TikZ. We will examine the structure of the code, the visual principles behind the illusion, and its significance in perception and visual art.

The following image is generated using TikZ, a powerful LaTeX graphics library designed for mathematical and scientific illustrations.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
  \fill[color=black!40!white] (-6,-6) rectangle (6,6);
  \foreach \n/\r/\twist in {70/5/12,56/4/-12,42/3/12,28/2/-12}{
    \foreach \m in {1,3,...,\n}
      \draw [thick,color=white,shift={(360/\n*\m:\r)},rotate=\twist+360/\n*\m]
        (-.15,-.15) rectangle (.15,.15);
    \foreach \m in {2,4,...,\n}
      \draw [thick,color=black,shift={(360/\n*\m:\r)},rotate=\twist+360/\n*\m]
        (-.15,-.15) rectangle (.15,.15);
    }
\end{tikzpicture}

\end{document}

The output produced:

ilusi
Circle or Spiral

This section explains each component of the code so you can understand how the pattern is constructed step by step.

\documentclass{standalone}
\usepackage{tikz}
\begin{tikzpicture}
  ...
\end{tikzpicture}
\fill[color=black!40!white] (-6,-6) rectangle (6,6);
\foreach \n/\r/\twist in {70/5/12,56/4/-12,42/3/12,28/2/-12}{
  ...
}

This line defines the core structure of the pattern.

  • \n = number of squares in one ring
  • \r = radius (distance from the center)
  • \twist = rotation angle for each layer With four combinations, we get four concentric circular layers, each with a slightly different rotation. The alternating 12 and -12 twist values make the outer and inner layers appear to rotate in opposite directions.

\foreach \m in {1,3,...,\n}
  \draw [thick,color=white,shift={(360/\n*\m:\r)},rotate=\twist+360/\n*\m]
    (-.15,-.15) rectangle (.15,.15);

This loop draws white squares at odd positions (1, 3, 5, …). Explanation:

  • 360/\n*\m determines each square’s angular position.
  • shift={(...:\r)} places the square along the circle’s radius.
  • rotate=\twist+360/\n*\m sets the orientation of each square.
  • The coordinates define the square’s size centered at its position.

\foreach \m in {2,4,...,\n}
  \draw [thick,color=black,shift={(360/\n*\m:\r)},rotate=\twist+360/\n*\m]
    (-.15,-.15) rectangle (.15,.15);
\end{tikzpicture}
\end{document}
  1. Color Contrast — The alternating black and white squares cause high luminance contrast, triggering visual sensitivity in the retina.
  2. Gradual Rotation — The slightly different twist angles between layers create the illusion of counter-rotating rings.
  3. Microsaccades — Tiny involuntary eye movements make static patterns appear to move, reinforcing the illusion.

You can modify several parameters to create new visual effects:

ParameterDescriptionVisual Impact
\rCircle radiusChanges ring size
\nNumber of squaresAlters pattern density
\twistRotation angleAdjusts illusion direction and strength
ColorOther color pairsAffects depth and vibrancy
Example modification:
\foreach \n/\r/\twist in {60/5/10,50/4/-10,40/3/10,30/2/-10}{
  1. Gregory, R. L. (1997). Eye and Brain: The Psychology of Seeing. Oxford University Press.
  2. Kitaoka, A. (2003). Rotating Snakes Illusion. Akiyoshi Kitaoka’s Optical Illusions.
  3. Ware, C. (2013). Information Visualization: Perception for Design. Morgan Kaufmann.
  4. The PGF/TikZ Manual, Version 3.1.10 (2023).

Written by: Aan Triono License: CC BY-SA 4.0

Related Content