The Mandelwat Set
medium.com
medium.com
It's a nice documentary, though. Highly recommend it. They even have an interview with Benoit Mandelbrot himself, may he rest in peace.
Two years after that, I wrote my first Mandelbrot-renderer. First in Python, but that was waaaay too slow, then in C, which was a lot faster (duh!), and then I made it even faster by telling the compiler to use SSE. (To some, that sounds trivial, but it was something I had never done before.)
I have always suspected that it is like a rite of passage, building at least one simple-minded Mandelbrot renderer. I rewrote mine after two more years to take advantage of multiple threads and wrote another one to render the Buddhabrot[1]. Then I remembered an article I had read years before, about the Parallel Virtual Machine, PVM. So, the next weekend, I turned my Mandelbrot renderer into a distributed application.
So Kudos to the author. Tackling the Mandelbrot set has the dual advantage of being interesting and you can make pretty pictures along the way. It is great fun, and I learned a few things along the way. What more could I ask for?
It's funny that of all the things I'm 'jealous' of in modern tech, the thing that still blows me away is just how fast I can generate/zoom around fractal sets, just for the hell of it, on my phone. This much computing power in the palm of one's hand was inconceivable to me at the time!
At the university where I study and work as a TA, all CS students have to write a Mandelbrot generator (we provide a simple GUI for them) in the second programming course.
Everyone is always very happy with the results and many consider it one of the coolest things they've done with programming up until then. I think assignments like those make them more enthusiastic about programming, which we (imo) need more of.
[1] https://www.youtube.com/watch?v=zxIcydL7wwY [2] https://benedikt-bitterli.me/buddhabrot/index.html
These days?
$ sudo apt install xaos
$ xaos
Click in the window, hold the mouse button down, watch.I load and run a Applesoft BASIC program that plotted the Mandelbrot set - oh...so...slowly. It's one saving grace was that it used a special ML program (something I found in Byte magazine or somewhere) which - on a machine equipped with an 80 column card (and the extra memory it afforded) would enable a high-resolution mode with access to all 16 colors.
So I'd run it - and let it plot...
By the time lunchtime came around, it would be finished, and it saved the image to the floppy. I'd then manually pick some new coordinates, and run it again to "zoom" in to an interesting area.
My last period was in that class (it was an elective, and one year I took it twice per day just to pass the time and gain an easy "A") - and by that time the new plot would be done and saved.
The next day I'd repeat it again. After about four iterations, though, it would be running too slow to finish a plot in time. So - I'd start again, and zoom in somewhere else. The teacher enjoyed it, and the other students liked seeing the pretty pictures.
Nobody really understood the math, though.
These days, a fractal renderer is one of my go-to toy projects to learn a new language/environment. It pulls together basic code, graphics, GUI, file operations etc. and produces something pretty too, while giving me a feel for the speed of the environment in question.
For the final projects most of the students made simple games such as pong or breakout. But I decided to write a Mandelbrot/Julia set viewer and had to dig into writing my own shaders in HLSL? (been a few years). At the end of the day flying around the sets with a controller in real time to Jonathan Coultons "Mandelbrot Set" felt bloody amazing.
I’m not really going to get into set theory because I don’t know anything about it tbqh, but maybe it’s worth a mention? Wonder what would be a really good succinct but not wrong explanation of set theory…"
"Sets wtf is a set", I don't know Bob, what is grammar, and why doesn't your article have any?
"lol, sets? one of the fundamental sections of mathematics? Wut r those lel? who cares I do js, fuck learning about what's going on when you're here to write a trite, subpar blog post on the subject"."...but maybe it's worth a mention?" I don't know, is literally one of the fundamental parts of the underlying mathematics important? "...Wonder what would be a really good succinct but not wrong explanation of set theory…" Here's an idea, take literally 3 seconds, or the minimal amount of effort you have and search 'introduction to set theory'. I can almost guarantee that there is a plethora of fantastic resources out there. Hell, Wikipedia is often more than adequate for mathematics topics. Also, unless you're a James Joyce tier writer, this stream of consciousness style writing is exceedingly poor form and should be avoided. It adds nothing and really only serves to tell the reader how little you know.
Set theory is fantastically interesting and powerful, but it's very very understandable to brush past it so we can get to the pretty pictures.
Also, if I do actually "take 3 seconds and search 'introduction to set theory'" I find two (excellent)[0] resources that, in their introductory paragraphs alone, rival the largest sections of the original link.
I live overseas and have no reason to talk to kids so I'm totally out of touch with the "real Millenial generation". But I want to know how they talk and think about things. I tried "Millenials react to X" videos but nothing is that useful.
I don't think it's very good if I'm totally out of touch or don't understand the Millenial generation at all. For me ( 80s so that's a gen-x-er? ) Millenials really seem like an important generation to understand...they grew up with the internet. They act differently online to the rest of us ( more privacy conscious and so on ). It's frustrating that I can't find any first-hand sources or interviews to see how they think and talk -- except things that are parody / making fun of it...or just theorizing by "experts".
The other side of this is about inspiration. I realized that as I got older, my "generational culture" ( for want of a better word ) is basically static. The shows, the movies, the music, the people, the scene, the lifepaths, opinions and ideas of peers...it's all just...so familiar. So boringly familiar. And unchanging.
Only the new generations can really have some vibrance, vitality and fresh inspiration, in a very organic sense, in my opinion. Not just fresh relative to another, static generational culture, but somehow inherently fresh and inspiring. It really makes me appreciate youth in a way I didn't before. As, if nothing else, this source of a fresh way of looking at the world. I also think that youth who grew up in the last 17 years, have to be some of the most interesting, or somehow express the most faithful reflections our world right now -- because they were literally shaped by all the huge changes that Earth has gone through -- Western political changes, rise of China, terrorism, social media. So I think to some extent if people want to understand the world we live in now, we have to understand the generation that grew up shaped by it.
The text certainly didn't inspire me to enable JS so I could see the code or images.
I think it's a shame we seem to be veering ever more toward 'code is all that matters' (or whatever the product of work is if not code) - not writing, presentation, communication, etc. - the result is rampant unprofessionalism.
" Outside the scope of this textbook".
The similar phrase, frequent in textbooks:
" Proof left as an exercise to the reader"
was no less annoying. But you can't cover everything and given that sets aren't important to this post, indeed covering them would be more confusing since the Javascript Set.prototype has things such as being finite, and strict equality.
This article is not an introduction to the mandelbrot set, it's "how to draw the mandelbrot set in javascript". I read this as a programming blog post not a mathematics blog post and enjoyed it.
Oh and I can't believe Github still does that whole "hosted with <3" bullshit.
Granted, I only skimmed the article and read in detail the parts that were most interesting to me, but I thought it was decent. Certainly, as an introduction - something to whet the appetite and spark interest on a subject in someone who knows nothing about it - I thought it did a great job, and I liked the fact the author has bothered to link to other resources if you want to take things further.
Sure, the writing style isn't going to be to everyone's taste, but, whatever.
https://jeremykun.com/2014/05/26/learning-to-love-complex-nu...
CGA had a 320x200 4-color mode. My program had a hardcoded bounding box that it would evaluate, and generate a 320x200 rendering of. I had to leave it running overnight for it to run to completion. I would set up the bounding box in the source file, start running the program, then wait until the next day for it to complete. It was awesome. Modern hardware could probably do the same thing in a few milliseconds. I'm sure it being written in GW-BASIC didn't help. :) Still, good times. That was the first thing I ever did that sort of resembled graphics programming.
I spent quite a bit of time with a mate of mine over the summer of 1992 writing compression algorithms in GW-BASIC on his dad's 8086 powered PC, equipped with CGA graphics. Another friend had a computer with EGA (gasp!) graphics. Almost no-one had a "decent" (i.e., even remotely current) spec PC back then, and I was on an Amiga 500.
When, just after we'd finished our A-level exams in 1994, first friend's dad upgraded to a 486SX33 with some sort of SVGA card that was capable of running DOOM - and doing so smoothly - minds were duly blown. And that's where that summer went.
It made the mobile experience pretty bad (all I get are links to the gists) and it would definitely "pollute" my gist history with a lot of little code snippets.
On the note of the topic itself, though, this was a fun read for building fractals in JavaScript!
I understand this is meant as a joke, but I also think that's part of the reason why Node became so big.
While that's clearly meant to be somewhat of a joke (from a medium account called dailyjs as well), it's this kind of annoying attitude that has lead to js being forced into lots of other avenues.
Also, is js really even the best tool for this? I feel like you're going to get far better pictures and faster results from language closer to the metal like C/Rust/Java(???).
In other words... No. But experimenting with JS still can have value.
Javascript is a nice hacking tool if you keep it in the browser.
For visualizing the Mandelbrot set? No. For writing an article on the web about incrementally building it up? Yes.
Realistically speaking, any toy fractal renderer like this will be an order of magnitude or two away from a heavily tuned one employing every trick in the book anyway, regardless of language.
How about a good old-fashioned image that doesn't require the viewer have JS enabled?
WebGL is, and the author actually uses this for his "final" implementation (linked from article).
I sort of get the JS hate (sort of) but if you want to do things in the browser then you're either using JS, or something that compiles to JS, or WebGL (1).
(1) If you're really lucky and only care about targeting supporting browsers you might also consider WebAssembly, and then you can use C or Rust, but for many scenarios that's still not an option. (And I doubt it would be faster than a shader-based WebGL implementation that runs on the GPU, for this scenario.)
I often write fractal renderers when I'm bored, usually batch rather than interactive ones. My most recent was able to parallel draw using several hundred servers, it was great fun.
Next steps for me after mandelbrot, on my most recent run, were the burning ship fractal, then fractals using floating point (Glynn Trees) and imaginary exponents, then Pickover Biomorphs (which I love to look at) Never quite got my phoenixes working....
And then I got some real work to do !
There are a few more videos related to PI and The Mandelbrot set, Julia, etc. All nice to watch. https://youtu.be/d0vY0CKYhPY
https://blogs.msdn.microsoft.com/shawnhar/2006/12/11/sixty-f...
I took the code from that article and combined it with the normalized iteration count algorithm:
https://en.wikipedia.org/wiki/Mandelbrot_set#Continuous_.28s...
Running the result at 60FPS on a huge 1080p TV was a lot of fun!
EDIT: forgot the link godammit https://www.webofstories.com/play/benoit.mandelbrot/6
http://notmatthancock.github.io/software/func-iter/
There's more on how it works and so forth if you go to the explanation link.
Edit: it's computationally intensive to create the fractals, so it's not very suitable for mobile (although, there's a progress indicator).
As mentioned elsewhere, the Colors of Infinity doc is pretty good, if you've never gone beyond the T-shirts and trippy colors.
you need Canary.
It's a real, real joy to read all these memories about the set, thank you all!
> Although I'm a huge fan of tech writing for beginners, in this case I could have done with 0.6 as much whimsy.
Can I meet you in the middle somewhere?
No, but seriously, there are what I consider very good reasons to adopt this tone. It's easier to write in a loose conversational style, first of all, and it's much more approachable for a wider variety of readers. But most importantly, to me anyway, is that I want to avoid even the semblance of an authoritative voice derived solely from the tone of the writing. Case in point:
> It's just a way of saying: "Outside the scope of this textbook".
That's exactly right. I'm not going to explain such a huge branch of mathematics with any justice in a short blog post, so I'm not even going to try. The cursory definition of "what you probably think it is" is more than adequate to get to the point, and I want to be clear about what I do and do not actually understand. To me though, "Outside the scope of this post" bespeaks of an author's deep and abiding understanding of the subject, as if he or she doesn't feel it necessary to deign to share that understanding just yet. For me, for this subject, This is not accurate, and I don't want readers to feel like it is.
> only serves to tell the reader how little you know.
This is also exactly right. I don't know much about sets, at all. I could read about them! I'd love to read about them, and I probably will sometime. But I don't know much about them right now. I think it's _more_ important, not less, that I am clear about that. This post is written for someone who doesn't have a strong math background and is only just learning about the Mandelbrot set, in effect, me from a few months ago.
The authoritativeness of the post should come from the provable validity of the contents, not the airs of the author. I had this post vetted by JavaScript ~ninjas~ and a Math phd to avoid putting out bad information, that's much more important to me than proving that I know everything, because I don't.
That said, I want it to be an enjoyable read for anyone, so I'll keep the tonal crits in mind.
> A bit unrelated, but it's weird that Medium doesn't seem to support embedded code, and instead only seems to work with gists. It made the mobile experience pretty bad (all I get are links to the gists) and it would definitely "pollute" my gist history with a lot of little code snippets
I agree.
> Am I the only one that was a bit disappointed to find it's a beginner introduction to the Mandelbrot set? The title led me to believe there was some modification or something new =/
I'm sorry; but if I had truly discovered a new fractal set, I probably wouldn't be publishing it on Medium first. :) Mandelwat was just too good a pun.
> Somebody introduce this guy to the Mandlebulb.
The Mandlebulb blows my mind.
> I understand this is meant as a joke, but I also think that's part of the reason why Node became so big.
I agree.
> I feel like you're going to get far better pictures and faster results from language closer to the metal like C/Rust/Java(???).
Yes, this is self evidently correct. Did you even open the post? One of the first hyperlinks goes to the widget that I finished the project with, which uses WebGL to render ~60fps interactive zooms up to the limits of 32 bit floats: http://mandelbrot.jfo.click
Thank you all for reading, it is really awesome to be able to share something I just learned and am excited about with so many people!!