You're reading: A Gardner's Dozen in TikZ

5. Mathematics of the “I Ching”

I’m aperiodically working my way through Martin Gardner’s cover images from Scientific American, the so-called Gardner’s Dozen, attempting to recreate these in the LaTeX drawing package TikZ. View the previous attempts.

This time I chose January 1974. The cover image relates to the article ‘The combinatorial basis of the “I Ching,” the Chinese book of divination and wisdom’, reprinted as chapter 20 in the book Knotted Doughnuts and Other Mathematical Entertainments.

Scientific American cover January 1974

I recently read about the I Ching in a history of combinatorics book and had forgotten there was a Martin Gardner column about it. It’s a divination manual, old enough to be semi-mythical in origin, and interesting because it contains a set of trigrams, the symbols included in the image as eight sets of yellow lines, which combine together to form 64 hexagrams. Each symbol has a meaning – actually several, for example when used to represent animals, starting at the top of the figure and moving clockwise these represent horse, fowl, pig, dog, cow, dragon, pheasant, and sheep.

The first thing to notice in terms of drawing the figure is that it is fundamentally circular. Lots of the image can be made by drawing concentric circles. In TikZ everything you draw appears on top of the previous content, so a lot of what we are seeing can be made by layering circles. For example, here the draw=none indicates that we don’t want a border, and fill gives it the right colour. We specify the centre of the circle as (0,0) and the radius in ex.

\begin{tikzpicture}
    \draw[draw=none,fill=red] (0,0) circle (13ex);
    \draw[draw=none,fill=black] (0,0) circle (11.5ex);
    \draw[draw=none,fill=purple] (0,0) circle (10ex);
    \draw[draw=none,fill=black] (0,0) circle (9ex);
\end{tikzpicture}

produces

Overlapping circles in black, purple, black and red

The centre is a yin yang symbol, or rather one yin and yang – the broken and unbroken lines in the trigrams also represent yin and yang, respectively. I think it’s rotated compared to how I’d expect to see it and I’m not sure why.

This can be made by drawing circles, hopefully this is clear if I draw the symbol with some circles outlined above it.

Ying and yang symbol with overlaid circles showing the different coloured parts are made up of circle arcs.

In the centre of the image we currently have a black circle. Drawing the four circles in the middle is just a question of getting the coordinates and radii right. The other thing we need to do is colour the top half red.

We can draw a partial circle using the arc command, and fill this red to get the desired effect. To use arc, we specify the start angle, end angle, and radius. Unlike circle which centres itself at the coordinates given, arc instead starts the arc at the coordinates given. Here I’ve marked the centre of the circle so we can see what is happening.

Circle and arc, showing that the arc starts at the circle's centre.

To deal with this we move the coordinate, here using the polar coordinate (angle:radius) 0:9ex. The code below draws the yin yang symbol.

\begin{tikzpicture}
    \draw[draw=none,fill=black] (0,0) circle (9ex);
    \draw[draw=none,fill=red] (0:9ex) arc (0:180:9ex);
    \draw[draw=none,fill=black] (-4.5ex,0) circle (4.5ex);
    \draw[draw=none,fill=red] (4.5ex,0) circle (4.5ex);
    \draw[draw=none,fill=red] (-4.5ex,0) circle (1.5ex);
    \draw[draw=none,fill=black] (4.5ex,0) circle (1.5ex);
\end{tikzpicture}
yin yang symbol

The last thing we need to draw is the yellow lines. I drew these not as filled circles with other circles drawn on top, like the bulk of the image, but as thick arcs of circles (using draw rather than fill), again shifted using a polar coordinate. For example

\draw[draw=yellow,line width=2.5ex] (73:17ex) arc (73:107:17ex);

draws a 2.5ex thick yellow arc from 73° to 107° at a radius of 17ex, centred at the origin.

For the broken lines, I drew two arcs with a gap of 4° in the middle. Interestingly, this means the gap is bigger on the outer arcs than the inner ones, an effect also present in the original image.

In fact, I drew the arcs using a couple of \foreach loops for ease, you can see how this was done in the full code.

And here is the final result.

Yin and yang symbol with I Ching trigrams.

(will not be published)

LATEX: You can use LaTeX in your comments. e.g. $ e^{\pi i} $ for inline maths; \[ e^{\pi i} \] for display-mode (on its own line) maths.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>