Fourier series visualisation with D3.js
<p><pre><code>  function FT(A, N, φ) {
    φ = φ || 0;
    return function(x) {
      var n = -1, y = 0;
      while (++n < N) {
        y += A[n] * Math.sin(τ * (n + 1) * x + φ);
      }
      return y;
    }
  }
</code></pre>
hehe, seems annoying to type. Copy&paste everytime one of them is needed?