The Modular Times Table, Explained
After reading this you will know why joining each number to its multiple on a circle traces a cardioid at multiplier 2, a nephroid at 3, and a whole family of epicycloids beyond, and you will be able to predict how many cusps appear before you draw a single chord.
What the picture is
Take the numbers 0 to N-1 and space them evenly around a circle. Pick a multiplier k. Now draw a straight chord from each point i to the point (i \cdot k) \bmod N. That is the whole rule. Nothing curved is ever drawn. Yet the chords crowd together along smooth curves, and those curves are the star of the show.
Try k = 2 with N = 200. Point 1 joins point 2, point 50 joins point 100, point 150 joins point 300 mod 200 = 100. Do this for all 200 points and a single heart-shaped curve appears in the middle. That curve is a cardioid. You did not draw it. It is the boundary that all those straight lines lean against, and mathematicians call such a boundary an envelope.
The hook is that ordinary multiplication, the times table you learned as a child, hides these curves. Change k to 3 and the cardioid becomes a two-lobed nephroid. Change it to 4 and you get three cusps. The pattern of cusps is exactly k - 1, and the rest of this article explains why.
When this model helps and when it does not
The modular times table is a teaching device for one precise idea: a family of straight lines can define a curve that none of the lines resemble. That idea, the envelope, shows up in optics (caustics on the bottom of a coffee cup), in gear design, and in the geometry of rolling circles.
Use it when you want to see epicycloids built from something concrete, or when you want a quick feel for how modular arithmetic wraps a line around a circle. It pairs naturally with the Spirograph, which traces the same epicycloids by rolling one gear on another instead of by chords.
This is not a model of anything physical. The cardioid you see is a mathematical fact about circle geometry, not a measurement of the world. Do not read meaning into the colours or infer a "law of multiplication" from the shapes. The shapes are a consequence of one definition and nothing more.
The formula and why cusps appear
Put a point at angle \theta_i = 2\pi i / N on the unit circle. Point i sits at (\cos\theta_i, \sin\theta_i). Its partner sits at angle
Here \theta_i is the angle of the starting point, k is the multiplier, N is the number of points, and the \bmod N keeps the target on the circle by subtracting whole turns. As N grows large the fractional wrapping matters less and the partner angle is very close to k times the start angle.
So each chord connects a point moving at angular speed 1 to a point moving at angular speed k. The envelope of chords joining a point at speed 1 to a point at speed k is exactly an epicycloid: the curve traced by a marked point on a circle of radius r = 1/(k-1) rolling around the outside of a fixed unit circle. That rolling circle produces k-1 cusps.
Check it against the names. At k=2 you get 2-1 = 1 cusp, which is the single dimple of a cardioid. At k=3 you get 2 cusps, the nephroid. At k=5 you get 4 cusps. The rule never fails for whole-number multipliers.
Reproducing the demo: k = 2, N = 200
The demo button uses the field defaults, multiplier 2 and 200 points. Walk through four chords by hand and you will see the cardioid start to form.
- Point
10sits at angle 2\pi \cdot 10/200 = 0.3142 radians, that is 18 degrees. Its partner is (2 \cdot 10) \bmod 200 = 20, at 36 degrees. - Point
60is at 108 degrees. Partner (2 \cdot 60)\bmod 200 = 120, at 216 degrees. - Point
110is at 198 degrees. Partner 220 \bmod 200 = 20, at 36 degrees. Notice the wrap:220exceeds 200, so subtract one full turn. - Point
150is at 270 degrees. Partner 300 \bmod 200 = 100, at 180 degrees.
Each chord you draw skims past the same heart-shaped boundary. The cusp of the cardioid points toward angle 0 on the circle. With 200 points you draw 200 chords and the boundary is sampled densely enough to look like a solid curve. The single cusp confirms k-1 = 1.
How the number of points sharpens the curve
The envelope is a limit. Each chord only touches it at one place, so with few points you see a coarse polygon of tangent lines, not a smooth curve. Raise N and you draw more chords, each tangent to the same underlying epicycloid, so the boundary looks crisper.
The gap between the drawn boundary and the true curve shrinks roughly like 1/N. Compare a few values for the cardioid at k=2: with N = 20 the chords miss the true curve by a visible fraction of the radius, while at N = 400 the miss is about twenty times smaller and the eye reads a solid line.
Reading the patterns you get
A few facts turn the pictures into something you can predict.
- Cusp count
- For integer
k, count the sharp points on the envelope. There are k-1 of them. Fifty-one gives fifty cusps. - Symmetry from factors
- When
kandNshare a common factor, chords collapse onto fewer distinct lines and you see extra symmetry or repeated overlaps. At k=2, N=200 every target is even, so only the 100 even points ever receive a chord. - Large-k wrapping
- When
kis close toN, the target angle wraps many times and the envelope can look like a mirror of a small multiplier. At k = N-1 the map is (N-1)i \equiv -i, so every point joins its reflection and you get a diameter fan, not an epicycloid.
Common mistakes
The most frequent error is expecting the curve to be one of the chords. It never is. Every chord is straight; the curve lives only in how they crowd together. If you look for a single line that matches the cardioid you will not find one.
A second mistake is choosing N too small and concluding the shape is wrong. At N=20 the cardioid looks like a ragged pentagon. That is undersampling, not a different curve. Raise N to 200 or more before judging the shape.
To confirm a cusp count, freeze N at 300 or higher and set k to a clean integer. Non-integer k smears the cusps, so use whole numbers when you want to count them. Then read off k-1 and check by eye.
A third trap is reading the animation as physics. Sweeping k from 2 to 3 looks like a smooth morph, but the intermediate frames at, say, k=2.5 are not epicycloids with two and a half cusps. They are the honest envelopes of chords whose target angle is 2.5 times the start angle, which produce a self-crossing curve that only settles into a clean shape at whole numbers.
Related tools worth a look
The epicycloids here are close cousins of several other pages. The Fourier epicycles tool builds curves from stacked rotating circles, the same rolling-circle idea seen from the other side. The interactive unit circle grounds the angle arithmetic that every point here uses. For more number-theoretic pattern hunting, the Ulam prime spiral and Pascal's triangle mod n both draw order out of modular structure. If you like curves defined by a construction rather than an equation, the Bezier curve playground shows De Casteljau's method building a curve from moving points, and the chaos game grows the Sierpinski triangle from random jumps.
Frequently asked questions
Why does multiplier 2 make a heart shape?
Because joining every point to a partner moving at twice its angular speed produces the envelope of a circle of radius 1 rolling once around a unit circle. That rolling circle traces a cardioid, which has one cusp. The heart is the cardioid.
How many cusps will multiplier k give?
Exactly k-1 for whole-number k. So 7 gives 6 cusps and 100 gives 99. You can count them on screen once N is large enough to draw the curve cleanly.
Why do more points make a sharper picture?
Each chord touches the true curve at only one point, so more chords sample more of the curve. The gap between the drawn boundary and the exact epicycloid shrinks roughly like 1/N, so 400 points look about twice as sharp as 200.
What happens with a non-integer multiplier?
The cusps blur and the curve can cross itself. The shape is still the honest envelope of the chords, but it only settles into a clean epicycloid when k lands on a whole number. Sweeping through fractional values is how one clean pattern morphs into the next.
Is this related to the Spirograph?
Yes. Both draw epicycloids. The Spirograph rolls one gear on another to trace the curve directly, while the modular times table builds the same curve as the envelope of straight chords. Same family of curves, two different constructions.