Skip to main content
100%

Mandelbrot with P5.js

✓ Published1🌍 Public
CCurran Kelleher
Last edited Jan 31, 2024
Created on Jan 31, 2024
Forked from P5.js Starter

This visualization renders the Mandelbrot set as a monochrome fractal, mapping each pixel to a complex coordinate and coloring it based on iteration count using P5.js. The sketch initializes a canvas sized to its container, sets `pixelDensity(1)`, and loads pixel data via `loadPixels()`. It iterates through the plane, applying the recurrence `z = z² + c`, and determines brightness with `dist()` and `map()` functions. The code uses `noLoop()` to draw once, then `updatePixels()` to display the computed grayscale values.

AI-generated description
MIT Licensed

Similar vizzes