%
% Fabian Steiner, EM Tutorium Blatt3
% fabian.steiner@mytum.de
%

t = [-2*pi: 0.01: 2*pi];
y1 = sin(t);
y2 = t;
y3 = t - t.^3 / 6;
y4 = t - t.^3 / 6 + t.^5 / 120;

plot(t, y1, 'r', t, y2, 'b', t, y3, 'c', t, y4, 'g');
axis([-3*pi 3 *pi -5 5]);
title('Veranschaulichung des Approximationsprozesses einer Taylorentwicklung');
xlabel('x');
ylabel('y');
legend('sin(x)', 'T_1f(x)', 'T_3f(x)', 'T_5f(x)');
grid on;