# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Plot a spirograph

Contributed by:
Wolfram Staff

ResourceFunction["Spirograph"][ plots a spirograph for function | |

ResourceFunction["Spirograph"][ φ_{f}]plots a spirograph from 0 to |

Imagine a wheel rolling around a second wheel that is rolling around another wheel and so on. A point on the rim of the outermost wheel will trace an interesting curve in the plane. Let the radius and angular frequency of the *j*^{th} wheel be *r*_{j} and *n*_{j}. The point will be at the position in the complex *φ*-plane. The function Spirograph generates a picture of the path of the point.

Assume that there is a closed parametrized curve in the plane. Find the points *p*_{k} on the curve corresponding to a division of the parameter domain into *m* *d* parts, where *m* and *d* are positive integers. The *d* *m*-sided Maurer polygons (1989) are formed by joining the points *p*_{k},*p*_{k+d},*p*_{k+2d},…,*p*_{k+(m-1)d},*p*_{k}, for *k*=1,2,…,*d*.

Plot a spirograph:

In[1]:= |

Out[1]= |

A more complicated spirograph:

In[2]:= |

Out[2]= |

Half of the path of the spirograph:

In[3]:= |

Out[3]= |

Convert the curve to a polygon:

In[4]:= |

Out[4]= |

Spirographs with random values:

In[5]:= |

Out[5]= |

Set explicit values for "MaurerPolygons":

In[7]:= |

Out[7]= |

Default values for "MaurerPolygons":

In[8]:= |

Out[8]= |

Show the "wheels" that generate the spirograph:

In[9]:= |

Out[9]= |

Make an animation:

In[10]:= |

Out[10]= |

Spirographs had an important application in the 1940s, when they were used for the "manual" solution of polynomial equations of higher degree. To understand this, consider the following polynomial *poly* in the variable *z*:

In[11]:= |

Out[11]= |

Replace the variable *z* by its polar form, *r ⅇ ^{ⅈ φ}*, where

In[12]:= |

Out[12]= |

Show the spirographs for a range of values of *r*:

In[13]:= |

Out[13]= |

Zoom to a neighborhood of the origin:

In[14]:= |

Out[14]= |

Here is an even closer look:

In[15]:= |

Out[15]= |

These are absolute values and arguments of the zeros of the polynomial:

In[16]:= |

Out[16]= |

The spirograph curves corresponding to these absolute values all go through the origin:

In[17]:= |

Out[17]= |

An analog circuit was used to vary *r* and the corresponding spirographs were monitored using an oscilloscope. Further analysis to determine *φ* led to approximations of the zeros of the polynomial.

Wolfram Language 11.3 (March 2018) or above

- 1.0.0 – 17 April 2019

This work is licensed under a Creative Commons Attribution 4.0 International License