Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mandelbrot with P5.js

Public visualization

Viewing a saved revision (read-only)

34e51b8900b143168ad3a43b5bcca080

Mandelbrot with P5.js

0 stars1🌍 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