futurebird , to random
@futurebird@sauropods.win avatar

Taught my CS how to program a mandelbrot set generator from scratch today.

Still don't have the colors doing exactly the right thing. This is in python, but we'll sort it out in the next class.

The most annoying thing is making the magnitudes of the terms in the series into a number between 0 and 256 without knowing exactly how big they will get.

I need to find my old James Gleick book.

WesternInfidels ,
@WesternInfidels@mefi.social avatar

@futurebird @chris_radcliff Good golly I'm such a rusty old fogey. This took me way too long.

Mandelbrot, 8-bit style:

WesternInfidels ,
@WesternInfidels@mefi.social avatar

@futurebird @chris_radcliff I don't know a great way to share Python code, so I tried to translate this to p5js, which I can share:

https://editor.p5js.org/WesternInfidels/sketches/UnBpzbCqi

But the math doesn't come out the same, and the difference shows up in the design. Wild.

I guess I don't actually know how either Python or JavaScript do floating point. I think the Python version is more accurate. The JavaScript might be 100x faster, though.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • test
  • worldmews
  • mews
  • All magazines