TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Mandelbrot set in JavaScript

62 pointsby andradejralmost 9 years ago

10 comments

xemalmost 9 years ago
Related:<p>an interactive (zoomable) HTML&#x2F;JS mandelbrot with detailed (but not long) source code + a super tiny (200 bytes) Mandelbrot tracer: <a href="https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;miniMandelbrot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;miniMandelbrot</a><p>Also related:<p>ASCII Mandelbrot (111b): <a href="http:&#x2F;&#x2F;www.p01.org&#x2F;128b_mandelbrot&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.p01.org&#x2F;128b_mandelbrot&#x2F;</a>
评论 #11778119 未加载
cwmmaalmost 9 years ago
a fractal is much more fun when you can zoom<p><a href="http:&#x2F;&#x2F;calvinmetcalf.github.io&#x2F;leaflet-fractal&#x2F;#255&#x2F;-0.37&#x2F;0.6&#x2F;mandlebrot&#x2F;2&#x2F;-17.5&#x2F;-86.1" rel="nofollow">http:&#x2F;&#x2F;calvinmetcalf.github.io&#x2F;leaflet-fractal&#x2F;#255&#x2F;-0.37&#x2F;0....</a><p>course that&#x27;s MUCH more then 25 lines
评论 #11788331 未加载
cslalmost 9 years ago
The next step is smooth coloring. I&#x27;ve written a post explaining it here: <a href="https:&#x2F;&#x2F;csl.name&#x2F;post&#x2F;mandelbrot-rendering&#x2F;" rel="nofollow">https:&#x2F;&#x2F;csl.name&#x2F;post&#x2F;mandelbrot-rendering&#x2F;</a><p>The js code can be tested on <a href="https:&#x2F;&#x2F;csl.name&#x2F;mandelbrot" rel="nofollow">https:&#x2F;&#x2F;csl.name&#x2F;mandelbrot</a>
评论 #11779960 未加载
foobarrioalmost 9 years ago
Such a small code snippet! I wrote coloring using the triangle inequality in JS a couple years ago for someone on reddit:<p><a href="http:&#x2F;&#x2F;codepen.io&#x2F;anon&#x2F;pen&#x2F;Ircav" rel="nofollow">http:&#x2F;&#x2F;codepen.io&#x2F;anon&#x2F;pen&#x2F;Ircav</a><p>Amazing that we can write these things up so quickly in a browser.
greydiusalmost 9 years ago
Nice writeup.<p>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&#x27;d bet it would probably run pretty good nowadays.
potterrawralmost 9 years ago
Here is another one. click to zoom. modify hash for antialiasing and higher iteration count.<p><a href="http:&#x2F;&#x2F;jonathan-potter.github.io&#x2F;Mandelbrot&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jonathan-potter.github.io&#x2F;Mandelbrot&#x2F;</a>
staplungalmost 9 years ago
Also related...Newton&#x27;s method fractal: <a href="http:&#x2F;&#x2F;deathray.us&#x2F;newton&#x2F;" rel="nofollow">http:&#x2F;&#x2F;deathray.us&#x2F;newton&#x2F;</a><p>The JS source is longer.
oneeyedpigeonalmost 9 years ago
First code example is missing a closing brace on the innermost for loop.
评论 #11778075 未加载
ewalk153almost 9 years ago
What does this title mean? Why 51? Looks like a simple Mandelbrot set in Javascript.
hanozalmost 9 years ago
Where are the other 50?
评论 #11778031 未加载