fourier_series.py

Created by ferr0fluidmann

Created on January 21, 2020

168 Bytes

Simulates a sum of a Fourier sequence.


from math import *

def fourier_func(n = 1, x = 0):
  returnVal = 0
  for i in range(n):
    i += 1
    returnVal += sin(i*x)/i
  return returnVal