| > | periodic:= (x,a,b) -> x -(b-a)*floor((x-a)/(b-a)); |
| > | sawtooth:=x->periodic((Pi-x)/2,-Pi/2,Pi/2); |
| > | plot(sawtooth,-5..10); |
| > | fourier:=
(x,M) -> sum(sin(n*x)/n,n=1..M); |
| > | plot([seq(fourier(x,N),N=1..6)],x=-5..10); |
| > | plot([seq(fourier(x,N),N=1..20)],x=-5..10); |
| > | plot(fourier(x,20),x=-5..10); |
| > |