-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
250 lines (240 loc) · 7.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fractals etc</title>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Fractals etc</h2>
<img class="r-stretch" src="/img/math_tree.png" />
<p>Fredrik Meyer (19/10-2023)</p>
</section>
<section data-auto-animate>
<h2>Something beautiful</h2>
<h2 class="r-fit-text">
in the intersection of math and programming
</h2>
<div class="beautiful">
<div>
<img
src="/img/math_beauty.png"
alt="Photo of a male mathematician sitting at a desk, intently focused on his computer screen. Beside him are books about advanced mathematics and programming. On the computer screen, there's a visualization of a complex mathematical structure that glows in vibrant colors."
/>
</div>
<div>
<img src="/img/indras_pearls.jpg" />
</div>
<div>
<img src="/img/indra_2.jpg" />
</div>
</div>
<p>Also motivating with visual feedback and deep problems.</p>
</section>
<section>
<h2>What are fractals?</h2>
<div class="beautiful">
<div>
<ul>
<li class="fragment" data-fragment-index="1">
Self similarity
</li>
<li class="fragment" data-fragment-index="2">
Detailed at all scales
</li>
<li class="fragment" data-fragment-index="3">
Tendencies to chaos
</li>
</ul>
</div>
<div>
<div class="r-stack">
<img
class="fragment"
alt="Pictures from here https://www.treehugger.com/amazing-fractals-found-in-nature-4868776"
data-fragment-index="1"
src="/img/fractal_nature.jpg"
/>
<img
class="fragment"
data-fragment-index="2"
src="/img/romanesco.jpg"
/>
<img
class="fragment"
data-fragment-index="3"
src="/img/copper.jpg"
/>
<img
class="fragment"
data-fragment-index="4"
src="/img/foam.jpg"
/>
</div>
</div>
</div>
<p class="fragment" data-fragment-index="4">
No precise definition covering all use cases exist.
</p>
</section>
<section>
<section>
<h2>Mandelbrot</h2>
<img class="r-stretch" src="/img/mandelbrot1.png" />
<p>After Benoit Mandlbrot (1924-2010)</p>
</section>
<section>
<p>
Define a sequence $\{z_n\}$ by $z_{n+1}=z_n^2+c$. Then the
<i>Mandelbrot set</i> is defined as the set of $c$'s in the
complex plane such that $z_n \not \to \infty$.
</p>
<iframe
width="100%"
height="698"
frameborder="0"
src="https://observablehq.com/embed/@mcmcclur/julia-sets-and-the-mandelbrot-set?cells=widget"
></iframe>
</section>
<section>
<h2>Demo Time 🥰</h2>
<p>
<a
href="https://github.com/FredrikMeyer/processing/blob/master/mandelbrot/mandelbrot.pde"
>Mandelbrot-simulation</a
>
from back in the day. (remember to also check out the
<a href="https://paulbourke.net/fractals/burnship/"
>burning ship fractal</a
>)
</p>
<pre>
<code data-trim><script type="text/template">
double checkMandelbrot(int i, int j, int noIterations) {
Complex c = toComplex(new double[]{i, j});
double p = Math.sqrt(Math.pow((c.x-0.25), 2)+c.y*c.y);
if ((c.x < p - 2*p*p+0.25) && (Math.pow((c.x+1), 2)+c.y*c.y) < 1./16) {
return 0;
}
Complex z = new Complex(0, 0);
double k = 0;
while (k < noIterations) {
z = iterate(z, c);
if (z.normSquared() >= 4) {
break;
}
k++;
}
if (k < noIterations) {
double logzn = Math.log(z.norm()*z.norm());
double nu = Math.log(logzn / Math.log(2))/Math.log(2);
k = k + 1 - nu;
}
double color1 = Math.floor(k);
double color2 = Math.floor(k)+1;
double fracPart = k % 1;
if (k == noIterations) {
return 0;
}
return Math.log(((color2-color1)*fracPart + color1));
}
</script></code></pre>
</section>
</section>
<section>
<section>
<h2>IFS - Iterated Function Systems</h2>
<p class="fragment">
A set of contraction mappings \[ \left\{ f_i: \mathbb R^2 \to
\mathbb R ^2 \mid i=1,2,\ldots,N \right \}\] This gives us a
fractal that can be thought of as a "fix point": \[ S = \overline
{\bigcup_{i=1}^N f_i(S)} \]
</p>
</section>
<section>
<h2>Some examples</h2>
<div class="r-stack">
<img src="/img/ifs_fern.gif" alt="Barnsley Fern" />
<img class="fragment" src="/img/ifs_chaos.gif" alt="Chaos" />
<img
class="fragment"
src="/img/ifs_dragon.gif"
alt="IFS Dragon"
/>
<img
class="fragment"
src="/img/ifs_gallery.gif"
alt="Gallery of IFS"
/>
</div>
<p class="fragment">
Many examples here:
<a href="https://paulbourke.net/fractals/ifs/">Paul Bourke</a>
(the page is a treasure trove)
</p>
</section>
<section>
<h2>Demo time 🥰</h2>
<p>
Can generate pictures by starting with a point and iterating
randomly.
</p>
<img class="r-stretch" src="/img/ifseditor.png" />
<p class="fragment">
<a href="https://fredrikmeyer.net/ifs-editor/">IFS Editor</a>
</p>
</section>
</section>
<section>
<section>
<h2>Abelian Sandpiles</h2>
<p>Start with a pile of sand</p>
<img src="/img/steps_sandpile.png" class="r-stretch" />
<p>
See
<a href="https://en.wikipedia.org/wiki/Abelian_sandpile_model"
>Wikipedia</a
>
and
<a
href="https://nautil.us/the-math-of-the-amazing-sandpile-238320/"
>this nice Nautilus</a
>
article.
</p>
</section>
<section>
<h2>
In
<a
href="https://github.com/FredrikMeyer/abeliansandpile/tree/main"
>Rust</a
>
</h2>
<img src="/img/sandpile1.png" />
<p>Show different starting points</p>
</section>
</section>
<section>
<h2>Conclusion</h2>
<ul>
<li class="fragment">Fun</li>
<li class="fragment">Learning (some algorithms are slow)</li>
<li class="fragment">Math is beautiful</li>
</ul>
</section>
<section>
<h2>Takk for alt!</h2>
<p>
My last fagdag-talk (in a while!?) 🥺 It has been really fun to get
to know you all, and I really hope our paths will continue crossing.
</p>
</section>
</div>
</div>
<script type="module" src="/main.js"></script>
</body>
</html>