Inspiration

I have been fascinated with fractals since last summer. Since then, I have been exploring the math behind them and trying to program them. I suddenly realized that fractals are the perfect things to bridge the gap between mathematics/technology as well as the gender gap in STEM fields. This is true simply because fractals combine the two abstract worlds – logic and creativeness/arts.

What it does

This project shows the beauty of fractals, namely a simple fractal tree, and the Mandelbrot/Julia Set. It will guide students to look behind the everchanging and colourful patterns on the surface to study the math/program behind it, such as complex number computation, coordinates, quadratics, and recursive loops. Those artistic math patterns could be the beginning of a girl’s exploration of mathematics and the technology world.

How I built it

I built it with p5.js and Processing which help with graphic displays, some knowledge and some research about complex numbers and the math behind the Mandelbrot/Julia Set: https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set and https://en.wikipedia.org/wiki/Julia_set. The looping animation is achieved by

float real = 0.7885 * sin(angle);
float imaginary = 0.7885 * cos(angle);

and the complex constant controlled by mouse position is achieved by

float real = map(mouseX, 0, width, -1, 1);
float imaginary = map(mouseY, 0, height, -1, 1);

Challenges I ran into

I had some problems with displaying colours with HSB colour mode and it would just display a single colour and not a gradient, but I fixed that with some online searching. I also got stuck while trying to display the Mandelbrot Set with histogram colouring. I did not figure out a way to work this out but I will definitely study this after this event.

Accomplishments that I'm proud of

I am extremely proud of myself when the last bug disappeared, and the Mandelbrot Set appeared on my screen. It was just amazing. Later on, I was also proud when I was able to set the complex constant in the Julia Set with my mouse position parameters so that I could control the pattern with my mouse position.

What I learned

I learned about the map(variable, from, to, from, to) method, HSB colour mode, as well as complex number computation. I also learned some new methods in java and JavaScript by using tools like p5.js and Processing.

What's next for Julia Set

Due to my limited abilities, I was not able to embed the Processing application onto a web page. I will work on that aspect and explore more about 2D/3D fractal displays. Furthermore, I plan to learn more ways to show the beauty of the Mandelbrot/Julia Set, namely histogram colouring, continuous/smooth colouring, as well as interior distance estimation. For the final product, I want to create a functional and interactive website that showcases the beauty and intricacies of fractals that people can play with and explore the math/code behind it.

Built With

Share this project:

Updates