|
Spirograph Emulator: Executable or Text Version
Proper screensaver version
If you're as old as me, you'll remember a toy called SPIROGRAPH. The original version consisted of patterns made by putting a pen through a hole in a toothed wheel, and rolling it around the inside of a larger wheel.
Mathematically, it's a CYCLOID curve rolling around on the inside of a circle, rather than on the flat. A cycloid is the curve a bicycle valve makes as a bicycle wheel rolls along the road. If "R" is the radius of the big wheel, "r" is that of the small wheel, "rm" is the modified radius as far where the pen pokes through a hole, and "phi" is the angle through which the smaller wheel has rotated, then the x and y positions on screen are given by;
x= (R-r)*sin(r*phi/R) - rm*sin[(1-r/R)*phi] and y= -(R-r)*cos(r*phi/R) - rm*cos[(1-r/R)*phi]
|
|