Monday, December 29, 2014

Compound Fourier Series Surfaces


This gif demonstrates how combinations of Fourier series mathematical functions can be used to create complex animated surfaces like these: Fourier Series, & Rectify. Fourier series functions create certain periodic waves such as square, triangle, sawtooth, or semicircle waves from the sum of simple sine waves. In this example a Processing program uses combinations of sine waves and Fourier series functions to simulate a complex undulating surface.

Simple sine waves applied to the vertical
and horizontal axes were used to generate a static base form:
   


The forms are projected in perspective with the amplitude of a sine wave modulating the z axis depth in space. When the two are added together they make:


Fourier series triangle wave functions applied to the horizontal and vertical axes, and added together make:
   


Using a different frequency there are four times as many triangle waves as there were sine waves. Combining all four functions, two sine and two triangle Fourier series waves, makes:
   

Animating the composite form by moving the triangle waves across the static sine waves makes the final gif, top.

For simplification, two of the four functions that are combined in this example are just sine waves. The other two Fourier series functions are only a few sine functions, sufficient to create a suitable triangle wave.

This example, as well as each surface in Fourier Series, & Rectify could be used to model physical surfaces.

2 comments:

Unknown said...

Fascinating! Are you sharing the source for this anywhere? I'd be interested in reading the algorithms. Great example, thanks!

jb said...

No, I haven't had any reason to share the source code. I never bothered to document it or clean it up, so I'm not sure it would be helpful. On the other hand, the program is pretty much as this blog describes. I use Processing's 3D graphics renderer. I generate the z value as described above in the blog, using sine waves and Fourier series equations. The z value also determines color and transparency. I hope that helps.