Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc.cso.uiuc.edu!garcon!altair!george From: george@altair (John George) Newsgroups: comp.graphics Subject: Re: Mathematica Summary: Here's a toy. Enjoy. Message-ID: <1868@garcon.cso.uiuc.edu> Date: 28 Aug 89 15:29:47 GMT References: <58589@tut.cis.ohio-state.edu> Reply-To: george@symcom.math.uiuc.edu (John George) Organization: Dept. of Mathematics, Univ. of Illinois at Urbana-Champaign Lines: 31 In article <58589@tut.cis.ohio-state.edu> writes: >(hope both these newsgroups are appropriate here) > >does anyone know what it's good for? (Ok I can read the instructions, >anyone have any novel ideas, interesting custom packages, hints & tips, ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >Thanx >Will Ray spirograph[p_Integer, q_Integer, a_, start_:0, opts___Rule] := Block[ {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."; Null; Try something like, spirograph[2, 3, .1]; spirograph[2, 3, .15]; and then Show[ %, %]. The latter command writes one design over the other. --John C. George