(* 	Author: John George
	Title: Spirograh.m
	Purpose: This package generates 
			 spirographs using Mathematica.*)

spirograph[p_Integer,q_Integer,a_,start_:0,opts___Rule] :=
	Module[{m=(q-p)/q, n=(q-p)/p, x=Cos[start], y=Sin[start]},
		ParametricPlot[{
			x(m Cos[t]+a Cos[n t])-y(m Sin[t]-a Sin[n t]),
        	y(m Cos[t]+a Cos[n t])+x(m Sin[t]-a Sin[n t])},
        {t, 0, 2 p Pi}, 
        opts, AspectRatio -> Automatic,
        PlotPoints -> 24, Axes -> None]
	];

spirograph::usage="spirograph[p, q, a, rot:0, (optionlist)]
displays the spirograph design formed by an outer wheel of
radius one and an inner wheel of radius p/q, with a pen
placed a units from the center; beginning at start radians
above the x-axis.";

Try something like, spirograph[2,3,.1];spirograph[2,3,.15];
and then Show[ %<line number of first output>, %<line 
number of second output>].The latter command writes one 
design over the other.

--John C. George

spirograph[2, 3, .1];

spirograph[2, 3, .15]

Show[ %4, %5]

Table[spirograph[2,3,n], {n, .1, .5, .05}];

Show[%10]

Show[Table[spirograph[2,3,n], {n, .1, 1, .05}]];

spirograph[4,10,.1]

spirograph[4,10,1]