Inspired by David Galloway's "Square Wave from the summation of odd-integer harmonic frequencies", I made a spin-off based on the same code:

This version provides an alternative solution that "completes the square" (so to speak), by alternating the phases and directions of the waves, in such a way that the projection on the other (real/imaginary) axis is also a square wave.

Thanks David Galloway for sharing your code.

Original program:
Animated Photo
Shared publiclyView activity