Pages

Tuesday, April 15, 2014

Fourier Series Grapher

Here's a simple JavaScript + HTML program I wrote. It will graph a given number of terms of a Fourier series. To graph a Fourier series, type the appropriate expressions into the text fields and click "Update." The text fields support JavaScript, so you can write a whole function in there if you need to.

I also added some functions.
  1. even(x) - returns true if x is even, false otherwise.
  2. odd(x) - returns true if x is odd, false otherwise.
  3. power(x, a) - returns xa.
Some examples of input to try:
  • odd(k)?(2/k):0
  • even(k)?(4/k/PI):0
  • odd(k)?(4/(k+PI)/k):0
The default Fourier series is equal to sin(2.5x) on (-π, π).

Enjoy!




To receive updates, subscribe now!