/MengerSponge

The Menger Sponge Fractal, coded in P5JS

Primary LanguageJavaScriptMIT LicenseMIT

MengerSponge

The Menger Sponge Fractal, coded in P5JS

Menger Sponge

Two, interactive versions available

I made two different versions of the Menger Sponge, both of them are interactive.

"MengerSponge" - Adding Iterations to the Menger Sponge

The folder "MengerSponge" contains a version, where you can click the Menger Sponge with your mouse, to add additional iterations!

"MengerSpongeCam" - Free-Flying camera and rotation-control!

The folder "MengerSpongeCam" contains another version, using PEasyCam for P5JS.

This one is really cool: You can rotate the whole Fractal with your mouse, as well as zoom into it.

Time to explore infinity!

Other, Closely related Fractals

The Menger Sponge actually is a three-dimensional version of two other very, very famous Fractals:

The Cantor Set

Did you know: The Cantor Set is a One-Dimensional version of the Menger Sponge!

It looks loke this:

Cantor Set

You can find out more about the Cantor Set here

The Sierpinski Carpet

If the Cantor Set is a one-dimensional Menger Sponge, what does a two-dimensional Menger Sponge look like?

Turns out there is another famous Fractal called the Sierpinski Carpet, and it looks like this:

Sierpinski Carpet

If you want to learn more about the Sierpinski Carpet, check out this link