Epitrochoid¶
By the end of this lab you'll be able to:
- Plot an epitrochoid — the curve traced by a pen on a circle rolling outside a bigger circle
- Explain how the sign difference between
(R + r)and(R - r)separates outer rolling from inner rolling - Predict the number of loops from the ratio
R / r
A small circle of radius r rolls around the outside of a big circle of radius R, with a pen attached at distance d from the small circle's center. The pen traces flower-like loops called an epitrochoid — the outside-rolling cousin of the Spirograph's hypotrochoid.
Welcome to the Epitrochoid!
In the Spirograph lab a circle rolled around the inside of a ring.
This time the little circle rolls around the outside — and just two
sign changes in the math flip the whole pattern inside out!
How It Works¶
At time t, the small circle's center sits at distance R + r from the origin (the two circles touch, so their centers are one big radius plus one small radius apart). The pen swings around that moving center, giving:
x = (R + r) * cos(t) - d * cos((R + r) / r * t)
y = (R + r) * sin(t) - d * sin((R + r) / r * t)
Compare with the Spirograph (hypotrochoid): inner rolling uses (R - r) and + d in the x line. That sign difference is the entire distinction between rolling inside and rolling outside. The curve makes R / r loops before it closes.
Sample Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
What Do You Think Will Happen?
The curve makes R / r loops before it closes. With R = 100 and r = 20,
how many loops will you see? Make your guess, then click Run!
Try It Now¶
5 loops — R / r = 100 / 20 = 5, and each loop gets its own color. Were you right?
How It Works¶
Every time the small circle rolls once around its own center, the pen swings out and back — that swing is one loop. Rolling around the outside of the big circle takes exactly R / r = 5 of those swings, so the curve closes after 5 loops. The pen distance d controls how dramatic each loop is: d bigger than r gives big open loops, d smaller than r gives gentle bumps, and d equal to r gives sharp points (that special case is called an epicycloid).
Explanation Table¶
| Line | What it does |
|---|---|
x = (R + r) * math.cos(t) - d * math.cos((R + r) / r * t) |
Center of the rolling circle plus the pen's swing — (R + r) means rolling outside |
d = 40 |
Pen offset from the small circle's center; bigger d means bigger loops |
(R + r) / r * t |
How fast the pen spins — the rolling circle turns 6 times per trip around |
colors[(i * 5) // (steps + 1)] |
Splits the 1200 steps into 5 color bands, one per loop |
Learning Check¶
Your Turn — Roll the Circle Inside
The program below uses the same R, r, and d, but this is the Spirograph
(inner-rolling) formula. Run it and compare with the curve above. Then convert it
to the outer-rolling epitrochoid: change every (R - r) to (R + r) and the
+ d in the x line to - d. Which way will the loops point after your edit?
The inner-rolling curve tucks its 5 loops inward and stays small; after your sign changes the loops flip outward and the whole curve grows — same three numbers, opposite rolling.
Experiments¶
-
Change
r = 20tor = 25. NowR / r = 4. You'll know it worked when the curve closes with exactly 4 loops. -
Set
d = 20(equal tor). You'll know it worked when the round loops sharpen into 5 pointed cusps — an epicycloid. -
Try
d = 10(smaller thanr). You'll know it worked when the loops flatten into 5 gentle bumps with no crossing. -
Set
r = 30soR / ris not a whole number. Change2 * math.pito6 * math.piso the curve has time to close. You'll know it worked when 10 loops weave around before the curve meets itself.
Rolling On the Outside!
You just discovered that one plus-or-minus sign decides whether a circle
rolls inside or outside — and completely changes the picture.
Up next: Superellipse — one exponent that morphs a star into a circle into a rounded square.