## Test it out:

Size of the spirograph

Inner circle radius

### Colors

### Why this Pack?

I remember that, as I kid, I loved to draw spirographs in class. A couple of months ago, I was reminded of spirographs and I immediately thought “these are mathematical. I wonder if I could make a Coda Pack that can draw them?”

I created this Pack to show that not all Coda Packs need to be work-related integrations (although there are ). This Spirograph SVGs Pack simply uses JavaScript math to produce beautiful spirographic visuals, just like when we were kids. ### How it works:

The entire Pack is built upon the parametric hypocycloid equation. This equation describes the x and y coordinates for a line plotted against each integer angle of a circle.

The math is relatively easy — just plug your information into the equation, and get X/Y coordinates that can be plotted.

The magic is that Packs can handle math like sines and cosines much faster than Coda docs themselves. Plus, Packs allow you to render SVGs. The result? Something I can have as much fun with as the original Spirograph toy. I hope you enjoy this fun Pack!

`🎨 This doc also uses Scott Weir's to make RGB to Hex color conversion easy.`