The idea: a times table drawn on a circle

Put N points on a circle and number them 0, 1, 2, …, N − 1. Pick a multiplier k. From every point i draw a straight line (a chord) to the point k·i. When k·i is N or more, go round the circle again: keep only the remainder after dividing by N. That is k·i mod N, clock arithmetic.

Ten coloured points on a circle numbered 0 to 9, with chords 1 to 2, 2 to 4, 3 to 6, 4 to 8, 5 to 0, 6 to 2, 7 to 4, 8 to 6 and 9 to 8. A table beside it lists i, 2·i and 2·i mod 10; the rows from 5 on are past 10 and wrap round
N = 10, k = 2: multiply by 2, and past 10 keep the remainder. Point 0 goes to itself.

With 10 points it is a tangle. With 200 points the chords crowd together and a curve appears that nobody drew: for k = 2 a heart-shaped cardioid. The page colours chord i by where i sits on the circle, from red at 0 through green and blue back to red, so you can follow the chords from one part of the circle.

The rule, step by step

For N = 10 and k = 2 (Demo: the rule chord by chord, or the Draw chord by chord button with N = 10 or 50):

ik·ik·i mod 10chord
0000 → 0, just a dot
3663 → 6
51005 → 0, a diameter
71447 → 4
91889 → 8

Point 0 always goes to 0. A point that goes to itself, k·i ≡ i (mod N), gives a chord of length 0; it is called a fixed point. The same mod-N arithmetic, done fast, is what Modular Exponentiation and Toy RSA is built on.

k = 2 is a cardioid, k = 3 a nephroid: k − 1 cusps

No chord is curved, but the edge of the crowd of chords is. That edge is the envelope of the chords: a curve that touches every one of them. Its shape depends on k:

Four circles with 200 points each. k = 2 shows a cardioid with one cusp, k = 3 a nephroid with two, k = 4 a curve with three cusps and k = 5 one with four. Orange dots mark each cusp, inside the circle
k = 2, 3, 4, 5: the envelope has k − 1 cusps (orange), each at (k − 1)/(k + 1) of the radius.
kenvelopecuspscusp distance from the centre
2cardioid (a heart)1R/3
3nephroid (a kidney)2R/2
4epicycloid33R/5
kepicycloidk − 1R·(k − 1)/(k + 1)

A cusp is a sharp point where the curve turns back on itself. Between two cusps the curve bulges out and touches the big circle; it touches it exactly where k·p ≡ p, the fixed points, so for k = 2 at point 0. (Demo: k = 2, N = 200: a cardioid, Demo: k = 3: a nephroid, Demo: k = 2, 3, 4, 5, 6: k − 1 cusps.) Another way to draw a cardioid is the polar curve r = 1 − sin θ: see Polar Coordinates, and for a heart drawn by a sine wave see The Heart Curve.

Why an epicycloid

Forget the points for a moment and think of every angle θ: the chord joins the point at angle θ to the point at angle kθ. As θ grows, the far end runs k times as fast as the near end. The envelope of those chords is an epicycloid: the path of a point on a small circle rolling round the outside of a fixed circle.

fixed circle radius  R·(k − 1)/(k + 1)        rolling circle radius  R/(k + 1)
cusps = fixed / rolling = k − 1             farthest reach = fixed + 2·rolling = R

For k = 2 both circles have radius R/3, and a circle rolling round an equal circle traces a cardioid. The rolling circle touches the fixed one at each cusp, so the cusps sit on the fixed circle, at R·(k − 1)/(k + 1) from the centre, and the curve reaches out to radius R in between. Rolling circles are what a Spirograph draws.

The N points only sample this picture. When k − 1 gets close to N the cusps are less than a few points apart and the envelope falls apart: the page draws the cusp dots only while k − 1 ≤ N/10.

Only k mod N matters

k·i and (k + N)·i differ by N·i, a whole number of turns, so they land on the same point. k = 102 with N = 100 draws exactly what k = 2 draws. That gives a few special values:

Four circles with N = 100. k = 101 is an empty circle; k = 99 shows vertical parallel chords; k = 51 shows 50 diameters through the centre; k = 34 shows a loop with one cusp inside a web of chords
N = 100: k = 101 is k = 1, k = 99 is k = −1, k = 51 sends odd i straight across, k = 34 hides k = 3/2.
k (N = 100)becausepicture
101 = N + 1101·i ≡ ievery point is fixed: nothing at all, like k = 1
99 = N − 199·i ≡ −ii joins its mirror image N − i: parallel chords
51 = N/2 + 151·i = i + 50·ieven i are fixed, odd i go to i + 50: 50 diameters
343 × 34 = 102 ≡ 2with i = 3j, chord 3j → 2j: the k = 3/2 picture, walked round twice

The last row is a trick worth knowing: 3 has an inverse mod 100 (3 × 67 = 201 ≡ 1), so i = 3j runs through every point once as j does. Then the chords of k = 34 are the chords from 3j to 2j, and a chord has no direction, so they are the chords of the "times 3/2" table. In the same way k = 67 draws the k = 3 nephroid. Whether 3 has an inverse is a question about gcd(3, N): see Euclidean Algorithm. (Demo: N = 100, k = 51 then k = 34, Demo: k = N + 1 looks like k = 1.)

Between whole numbers

k does not have to be whole. For k = 2.5 the chord from 3 ends at 7.5, half way between points 7 and 8: the page puts the end at the real position k·i mod N on the circle. Stepping k by 0.1 then moves every chord end a little, and the picture flows from one shape to the next instead of jumping. Press Play k 2 → 100: 981 frames, k up by 0.1 each time. (Demo: play k from 2 to 100.) Watch the cardioid grow a second cusp on the way to k = 3, then a third, until near k ≈ N/10 the cusps crowd together and the mod-N patterns take over. Every whole k up to 100 is visited, so k = 34, 51, 67 and 99 flash past. The speed choice sets the frames per step: about 100 s, 65 s or 33 s for the whole run.

Other pictures made by stepping round a circle in fixed jumps: the Maurer rose joins points of a rose curve the same way.

Another picture where one number and how close it is to a fraction decide the pattern: The Sunflower Spiral: Vogel's Model and the Golden Angle.

What the page leaves out

The proof that the envelope is an epicycloid (the derivative of the chord family), N other than 10, 50, 100, 200 and 360, negative k (use k + N), k above 101, the chord-by-chord drawing for N above 50 (it would take hundreds of steps), and pictures where the end of chord i is a power k^i mod N instead of a product. The cusp dots are only drawn for whole k with k − 1 ≤ N/10.