Approximation of a square wave (fundamental to the 9,999th harmonic)

View source on this frame to see my code. The blog post discussing this code is here.