TRada := proc (f, x0, n) option remember; sum(`@@`(D,i)(f)(x0)/i!*(x-x0)^i,i = 0 .. n) end; TPlots := proc (f, x0, n, int_x, int_y, degree) local p, text, tplot, j, bar; option remember; p := []; bar := 1/n; for j to n do tplot := plot(TRada(f,x0,j ),x = int_x,y = int_y,thickness = 2,color = COLOR(RGB,j*bar,0,1-j*bar)); if degree then text := textplot([op(1,int_x)+1/10*op(2,int_x), op(2,int_y), cat( `Stupen `,j)],align = BELOW); p := p, [display(tplot,text)] else p := p, tplot fi od end; TaylorAnimat := proc (f, x0, n, int_x, int_y) local p, fplot, tplots; p := TPlots(f,x0,n,int_x,int_y,true); fplot := display(plot(f(x),x = int_x,y = int_y,color = aquamarine,thickness = 4)); tplots := display(fplot,p,insequence = true); display(tplots,fplot) end; TaylorAnimat2 := proc (f, x0, n, int_x, int_y) local d, j, fplot, tplots; option remember; d := []; for j to n do d := d, [display(TPlots(f,x0,j,int_x, int_y,false))] od; fplot := plot(f(x),x = int_x,y = int_y,color = aquamarine, thickness = 4); tplots := display(fplot,d,insequence = true); display(fplot, tplots) end;