% Homework 12, problem 3: area of an ellipse

area(1:9) = 0;
for m = 1 : 9;
    N = 4^m;
    area(m) = MC_ellipse(N);
end;

plot(area, 'o-r'); hold on;
axis tight; set(gca, 'fontsize', 13);
plot([0 9], [2*pi 2*pi], '--');
legend('Monte-Carlo result', 'Exact result = 2\pi', 'Location', 'Best');
title('Calculating area of ellipse x^2/4 + y^2 < 1');
xlabel('log_4(number of points)'); ylabel('Area');

