% Implementation of the Henon map
%
% Parameters a, b:
% a: nonlinearity
% b: dissipation and folding


a = 1.4;
b = 0.3;

H_MAX = 100;
h = zeros(H_MAX,2);

% Initial conditions
h(1,1) = 0.6314;
h(1,2) = 0.1894;

plot( h(1,1), h(1,2), '*' );
xlabel('x');
ylabel('y');
axis([-1.5 1.5 -0.4 0.4]);
hold on;
drawnow;

% Find the later iterations recursively
for i = 2:H_MAX;
    h(i,1) = h(i-1,2) + 1 - a*h(i-1,1)^2;
    h(i,2) = b*h(i-1,1);
    
    str = [int2str(i)];
    text( h(i,1), h(i,2), str );
    
    plot( h(i,1), h(i,2), '*' );
    drawnow;
end

hold off;
h;
