Earlier this year Grant Sanderson, creator of the YouTube channel 3blue1brown, posted a video explaining how Fourier series approximate periodic functions using sums of sines and cosines. In the video and its companion, Grant animates sets of vectors that rotate on circular orbits and, when summed together, reproduce a range of images defined by closed curves.
Consider, for example, the boundary of GitHub’s logo:
Let be the closed curve in defining the logo’s boundary. Suppose there is an integer such that for some set of circular orbits and for all times . (Negative and positive subscripts correspond to clockwise and anti-clockwise orbits. Both may be necessary to reconstruct .) Each orbit has time position defined by the vector for some radius , angular speed rad/s and initial phase . Consequently, the curves defining the horizontal and vertical components of must satisfy the system of identities. Let be the curve with for all . Euler’s formula gives where each Fourier coefficient has modulus and (principal) argument . Now, notice that for each because for all integers by the -periodicity of the complex exponential function. Thus which can be calculated using Riemann sums given sample points along the component curves and . Doing this calculation for each , and computing the corresponding moduli and arguments , provides enough information to generate the animation below.