clc, clear, close all

x = pi/4;

true_value = sin(x);

increments = 10:10:110;
approx_values = zeros(1,11);

for i = 1:11
    val = 0;
    for k = 0:increments(i)
        val = val + ((-1)^k/factorial(2*k+1) * x^(2*k + 1));
    end
    approx_values(i) = val;
end

plot_values = -approx_values + true_value;

plot(increments,plot_values)