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:

http://www.khanacademy.org/computer-programming/spin-off-of-david-galloways-square-wave-from-the-summation-of-odd-integer-harmonic-frequencies/5154727290208256

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:

https://www.khanacademy.org/computer-programming/square-wave-from-the-summation-of-odd-integer-harmonic-frequencies/5389081424166912
Animated Photo
Shared publiclyView activity