Drawing super shapes

We call these shapes super shapes because we can build many interesting shapes using a single mathematical formula called Super Formula. See https://en.wikipedia.org/wiki/Superformula for more details on the formula.

The super formula takes six input arguments: a, b, m, n1, n2, and n3. Varying these five arguments produces varied shapes found in nature such as the shapes of shells, starfish, flowers, and more.

We do not get into why or how this formula works. All we do is write a method that, given these five arguments, returns the coordinates for unique shapes. We then pass these coordinates to our create_polygon method to create these shapes on the canvas. The method that returns these points is defined as follows (see ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.