- /
-
Eigenwalkers in love
on 29 Nov 2023
- 36
- 95
- 0
- 3
- 1920
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Remix of Cleve Moler's EIGENWALKER with a handholding partner
t = 0.13*(f-1);
c = 0.1*[1 sin(t) cos(t) sin(2*t) cos(2*t)]';
[V,H] = coef;
H(:,3) = H(:,2);
X = reshape(V*c,15,3);
X([2 3],1) = [223.1 197.7];
L = {[1 5],[5 12],[2 3 4 5 6 7 8],[9 10 11 12 13 14 15],[1]};
cla
axis([-310 750 -750 750 0 1500],'off')
set(gca,'xtick',[],'ytick',[],'ztick',[])
e = ones(size(H,1),1);
XH = [X(e,:)+H; X(5,:)];
line(1.44\XH(:,1),XH(:,2),XH(:,3), ...
'col',[3 2 0]/4,'lines','-','linew',1.5);
line(-1.44\XH(:,1)+440,XH(:,2),XH(:,3), ...
'col',[0 2 3]/4,'lines','-','linew',1.5);
for k = 2:4
line(X(L{k},1),X(L{k},2),X(L{k},3), ...
'col',[3 2 0]/4,'marker','o','markersize',8, ...
'lines','-','linew',1.5);
line(-X(L{k},1)+440,X(L{k},2),X(L{k},3), ...
'col',[0 2 3]/4,'marker','o','markersize',8, ...
'lines','-','linew',1.5);
end
view(0,0)
function [V,H] = coef
V = [ 5 -43 -182 0 1
2064 14 -131 11 39
2092 -215 -192 28 15
1660 -72 -173 -1 3
-7 -78 -173 2 1
-1664 -79 -178 4 -3
-2097 -246 -200 -28 -20
-2016 -36 -168 -19 -49
536 53 127 0 15
794 11 83 -3 47
931 -73 -145 1 -2
20 -63 -113 1 0
-883 -74 -146 1 -1
-831 17 74 2 -47
-567 61 125 0 -20
205 -11 -4 -37 27
500 -1010 -256 37 9
-686 -606 -174 -11 17
-59 -153 -52 -57 32
-114 -7 -4 -62 35
-177 139 44 -61 34
-717 691 170 -12 16
414 1174 254 36 0
-544 2214 -576 327 -259
859 1247 170 51 264
-42 -10 -29 -115 80
78 -10 0 -115 67
-58 -10 33 -116 79
832 -1240 -175 56 266
-557 -2227 586 349 -271
13837 1 0 70 86
7695 -189 -11 124 6
9721 61 44 82 59
12251 -20 22 76 85
12058 1 0 74 85
12320 21 -23 78 82
9774 -65 -39 83 49
7766 224 17 119 -23
984 -120 548 -105 266
4122 250 49 123 30
7897 -12 -31 70 84
8766 1 1 70 87
7889 13 32 70 86
4157 -249 -52 124 35
985 127 -548 -116 269];
N = [NaN NaN];
H = [80 0
74 31
57 57
31 74
0 80
-31 74
-57 57
-74 31
-80 0
-74 -31
-57 -57
-31 -74
0 -80
31 -74
57 -57
74 -31
80 0
N
-8 32
-9 38
-13 43
-18 47
-24 48
-30 47
-35 43
-39 38
-40 32
-39 26
-35 21
-30 17
-24 16
-18 17
-13 21
-9 26
-8 32
N
40 32
39 38
35 43
30 47
24 48
18 47
13 43
9 38
8 32
9 26
13 21
18 17
24 16
30 17
35 21
39 26
40 32
N
-48 -20
-32 -38
-16 -50
0 -53
16 -50
32 -38
48 -20
N
0 -80];
end
end