% Rydd opp
clc
clear
close
format shortG

% Rotasjon, skjevhet og steglengde
r = pi/4;
R = [cos(r) -sin(r); sin(r) cos(r)];
k = (sqrt(5)-1)/2;
t = 1/2;

% Matrise og startvektor
A = transpose(R)*[cos(t) -sin(t)/k; k*sin(t) cos(t)]*R
x = [1; 0]
y = [-1/4; 1/3]
pause(10)

% Koordinatsystem
axis([-2 2 -1.5 1.5])
axis equal
hold on;
plot(x(1),x(2),'.','MarkerSize', 20,'Color','b')
plot(y(1),y(2),'.','MarkerSize', 20,'Color','r')
pause(10)

% Let's go
n = 60;
for i = 1:n
    x = A*x;
    y = A*y;
    plot(x(1),x(2),'.','MarkerSize', 20,'Color','b')
    plot(y(1),y(2),'.','MarkerSize', 20,'Color','r')
    pause(2)
end