News for hackers. Stuff that matters.
Re:The Mandelbrot set in JavaScript by xem on Thursday May 26, 2016 @08:22AM (#11777336)
Related:

an interactive (zoomable) HTML/JS mandelbrot with detailed (but not long) source code + a super tiny (200 bytes) Mandelbrot tracer: https://github.com/xem/miniMandelbrot

Also related:

ASCII Mandelbrot (111b): http://www.p01.org/128b_mandelbrot/

Re:The Mandelbrot set in JavaScript by swietlik on Thursday May 26, 2016 @10:20AM (#11778119)
Wow, I'm impressed! This takes coding to a whole new level...
Re:The Mandelbrot set in JavaScript by cwmma on Thursday May 26, 2016 @07:46AM (#11777181)
a fractal is much more fun when you can zoom

http://calvinmetcalf.github.io/leaflet-fractal/#255/-0.37/0....

course that's MUCH more then 25 lines

Re:The Mandelbrot set in JavaScript by swietlik on Friday May 27, 2016 @03:29PM (#11788331)
Good point!

I was able to add the zoom capability without TOO much code:

http://slicker.me/fractals/zoom.htm

Re:The Mandelbrot set in JavaScript by csl on Thursday May 26, 2016 @10:11AM (#11778064)
The next step is smooth coloring. I've written a post explaining it here: https://csl.name/post/mandelbrot-rendering/

The js code can be tested on https://csl.name/mandelbrot

Re:The Mandelbrot set in JavaScript by hanoz on Thursday May 26, 2016 @01:43PM (#11779960)
Did you forget renew a domain name? The demo link in your post's opening paragraph is now leading to some kind of Japanese Bra company.
Re:The Mandelbrot set in JavaScript by csl on Thursday May 26, 2016 @02:17PM (#11780268)
Haha, thanks for spotting that! It should lead to the link in the above comment of course.
Re:The Mandelbrot set in JavaScript by foobarrio on Thursday May 26, 2016 @01:04PM (#11779587)
Such a small code snippet! I wrote coloring using the triangle inequality in JS a couple years ago for someone on reddit:

http://codepen.io/anon/pen/Ircav

Amazing that we can write these things up so quickly in a browser.

Re:The Mandelbrot set in JavaScript by greydius on Thursday May 26, 2016 @12:14PM (#11779121)
Nice writeup.

I did a mandelbrot viewer in javascript like 5 years ago. In fact, it was the only thing I ever wrote in Javascript besides dom manipulation crap. I wanted to try the canvas tag when it was first introduced, and this was the first project that came to mind. My version had color and let you click on the image to zoom. After about 20 clicks, it would run out of precision and the pixels would turn into larger and larger blocks. It was also slow as dirt back then. I'd bet it would probably run pretty good nowadays.

Re:The Mandelbrot set in JavaScript by potterrawr on Thursday May 26, 2016 @01:51PM (#11780044)
Here is another one. click to zoom. modify hash for antialiasing and higher iteration count.

http://jonathan-potter.github.io/Mandelbrot/

Re:The Mandelbrot set in JavaScript by staplung on Thursday May 26, 2016 @11:15AM (#11778539)
Also related...Newton's method fractal: http://deathray.us/newton/

The JS source is longer.

Re:The Mandelbrot set in JavaScript by oneeyedpigeon on Thursday May 26, 2016 @07:52AM (#11777207)
First code example is missing a closing brace on the innermost for loop.
Re:The Mandelbrot set in JavaScript by swietlik on Thursday May 26, 2016 @10:12AM (#11778075)
I corrected it now. Thanks for the good catch!
Re:The Mandelbrot set in JavaScript by ewalk153 on Thursday May 26, 2016 @09:48AM (#11777888)
What does this title mean? Why 51? Looks like a simple Mandelbrot set in Javascript.
Re:The Mandelbrot set in JavaScript by hanoz on Thursday May 26, 2016 @09:54AM (#11777925)
Where are the other 50?
Re:The Mandelbrot set in JavaScript by dang on Thursday May 26, 2016 @10:06AM (#11778031)
We changed the title from "51 Fractals – tutorial (only 25 lines of code)".