Posted November 7, 2014. Pretty. 141 words.


Despite the simplicity of their creation, a Spirograph can create complex and visually appealing shapes. Originally designed to help prevent banknote forgeries, the Spirograph is now a children’s toy sold worldwide.

Using commonly available mathematical equations I’ve created a simple simulation that creates many random Spirographs. Behind the scenes each Spirograph is rendered to a canvas buffer which is then drawn to the main canvas for performance.

Why not have a play, the code is available on GitHub.


  • Click or use +/-/C to create or remove spirographs.
  • Use the scroll wheel to speed up or slow down time.
  • Press space to play or pause the simulation.
  • Press T to toggle trails and I to invert.

Click here or the image above to start!

Get an email each week I post, zero spam             

StatCounter Pixel