/Spirograph

Primary LanguageMATLABMIT LicenseMIT

Spirograph

With this script you can generate and modify the animation of a spirograph using Matlab. The trajectory of the moving circles that draw the pattern is a circular oscillation-movement. Changing the associated parameters of the moving circles will change the pattern of the drawing:

  • r1, r2, r3 : Radius of the circles.
  • s1, s2, s3 : Speeds of the circles. s1 with value 7 means that circle 1 rotates 7 turns for each turn of the radial reference system.
  • k : Oscillations amplitude. k with value 0.5 means that the circles oscillate with respect to the radial reference system with an amplitude equal to half the radius.
  • n : Number of oscillations for each turn of the reference system.

Different patterns

$$ [k,n] = [0,8] $$

$$ [r1,r2,r3] = [9,7,5] $$

$$ [s1,s2,s3] = [9,5,7] $$

SpirographAnimation0 SpirographAnimation1


$$ [k,n] = [1,12] $$

$$ [r1,r2,r3] = [5,5,5] $$

$$ [s1,s2,s3] = [5,7,9] $$

SpirographAnimation8 SpirographAnimation9


$$ [k,n] = [0.25,8] $$

$$ [r1,r2,r3] = [3,4,3] $$

$$ [s1,s2,s3] = [3,5,7] $$

SpirographAnimation4 SpirographAnimation5


$$ [k,n] = [0.5,10] $$

$$ [r1,r2,r3] = [5,6,7] $$

$$ [s1,s2,s3] = [9,11,13] $$

SpirographAnimation6 SpirographAnimation7