Complex numbers, working with oscillations (trigonometry), using Turtles to draw, some basic algebra, my favorite, Cellular Automata, and more, are covered in Math Adventures with Python: An Illustrated Guide to Exploring Math with Code by Peter Farrell. Farrell is a math and computer science teacher who is interested in math education and using technology in learning.
The level of sophistication of the products this book aims for is fairly astounding, and using only basic Python tools. Better than a Spirograph.
The most interesting thing about the material provided by Farrell is how little coding is required to do spectacular and complicated math; you learn some very nice coding technique in this book. But at the same time you get to learn some math. Kids interested in coding can easily handle this in Middle School, with some guidance, and adults who want to learn Python and have a math orientation will love it. But it is also a good book to have around as a reference if you normally work with numbers, shapes, basic math, and things like complex numbers and systems of equations. You will find useful tools herein.
Math Adventures with Python is really fun.
Uses Python 3, and this is the TOC:
Part 1: Hitchin’ Up Your Python Wagon
Chapter 1: Drawing Polygons with Turtles
Chapter 2: Making Tedious Arithmetic Fun with Lists and Loops
Chapter 3: Guessing and Checking with Conditionals
Part 2: Riding into Math Territory
Chapter 4: Transforming and Storing Numbers with Algebra
Chapter 5: Transforming Shapes with Geometry
Chapter 6: Creating Oscillations with Trigonometry
Chapter 7: Complex Numbers
Chapter 8: Using Matrices for Computer Graphics and Systems of Equations
Part 3: Blazing Your Own Trail
Chapter 9: Building Objects with Classes
Chapter 10: Creating Fractals Using Recursion
Chapter 11: Cellular Automata
Chapter 12: Solving Problems Using Genetic Algorithms