DEV Community

Discussion on: What you learning about this weekend?

Collapse
 
michaeltharrington profile image
Michael Tharrington • Edited

Fascinating! I've seen fractal patterns and love them.

beautiful fractal pattern

Are you working with fractals in a visual design sorta way or can they be used logically in an application? Non-dev speaking here, so pardon my ignorance. I'm just imagining an infinitely repeating pattern having the potential to be used for something beyond looking awesome... which hey, it definitely looks awesome. I know there are very special mathematical properties to fractals, but I don't know much beyond that.

Collapse
 
piko profile image
Piko

Thank you! Yeah fractals are super fascinating!

Recently, I have been interested in taking mathematical concepts and using them to create visuals and designs with code. It has been a fun adventure, my most recent interest has been trying to create something with fractals or rather writing recursive functions to create designs. 2 days ago I made a fractal tree with the Canvas html element [In the gif it is the element with the black background]. Today, I started playing with SVG + JS to make a fractal tree. It has been mega fun! [an example is the tree with the white background].

Image description

Thread Thread
 
michaeltharrington profile image
Michael Tharrington

Super cool, Piko! Loving the looks of the fractal tree you created... especially the colorful one, haha. This could probably make for a pretty cool music visualizer.

Collapse
 
montyharper profile image
Monty Harper

Hey, Michael & Piko, I know a little about fractals from my mathematics background. A fractal is a shape with a fractional dimension. Whereas a line fills one dimension and a plane fills two dimensions, a fractal is infinite and takes up an infinite amount of space in a sense, but doesn't fill the entire dimension it's embedded in. So for example the one you posted there takes up part of a plane, but not the whole plane, since it's lacy and leaves a lot of fancy gaps and holes (typically only the points colored black are actually part of the fractal). So its dimension is a number somewhere between 1 and 2. That number is independent of scale, so no matter what small piece of the plane you look at, the fractal takes up that same proportion of the available space. In other words no matter how far you zoom in, you'll see the same level of detail. Fractals are generated by iterative processes and display certain properties, such as repetition of similar structures at vastly different scales. Anyhow, I think your gif is part of the Mandelbrot Set. That's something on my list of apps to make - an app that teaches about the Mandelbrot Set. It's mind-blowing how simple it is to generate, compared with the complexity of the resulting shape. Endlessly fascinating.

Thread Thread
 
michaeltharrington profile image
Michael Tharrington

Wow, thanks for this detailed explanation, Monty! This is helping me to understand.

Also, cool idea around creating the app that teaches about the Mandelbrot Set... I'd love to check that out!