Applied Math for Creative Coders
  1. Math Models for Creative Coders
  2. Geometry
  3. Fractals
  • Math Models for Creative Coders
    • Maths Basics
      • Vectors
      • Matrix Algebra Whirlwind Tour
      • Things at Right Angles
      • content/courses/MathModelsDesign/Modules/05-Maths/70-MultiDimensionGeometry/index.qmd
    • Tech
      • Tools and Installation
      • Adding Libraries to p5.js
      • Using Constructor Objects in p5.js
      • The Open Sound Protocol
    • Geometry
      • Circles
      • Complex Numbers
      • Fractals
      • Affine Transformation Fractals
      • L-Systems
      • Kolams and Lusona
    • Media
      • Fourier Series
      • Additive Sound Synthesis
      • Making Noise Predictably
      • The Karplus-Strong Guitar Algorithm
    • AI
      • Working with Neural Nets
      • The Perceptron
      • The Multilayer Perceptron
      • MLPs and Backpropagation
      • Gradient Descent
    • Projects
      • Projects

On this page

  • Inspiration: A Geometric Jewellery Store
  • An Introduction to Fractals
    • Julia, and Julia, and still more Julia….
  • Designing with Julia/Mandelbrot fractals
    • Jewellery Shopping with Mandelbrot
  • Fractals with Code
  • Wait, But Why?
  • References
  1. Math Models for Creative Coders
  2. Geometry
  3. Fractals

Fractals

Iterated Functions
Fractals
Mandelbrot
Julia
Published

May 2, 2024

Modified

July 19, 2025

Abstract
A Geometric Jewellery Store

What is in us that must reach the top, that longs to look down upon the world as if a god?
Don’t we know that in this infinite space the same rocks at the seashore know the secret of each peak?

Underneath the surface are caverns, caves soaring cathedrals the earth has made.
What arias does she sing to dripping water, bats and other seekers of wisdom?
What prayers echo while the ceilings reach slowly to the floor?

The open window houses everything:
a cat lounging in the sunlight, the call of neighbors, the breath of possibility.

- Robin Walthery Allen

Inspiration: A Geometric Jewellery Store

Photo by Mykola/Kolya Korzh on Unsplash

Photo by Mykola/Kolya Korzh on Unsplash

Explore some jewels here: https://math.hws.edu/eck/js/mandelbrot/MB.html

An Introduction to Fractals

Let us listen to the late great Benoit Mandelbrot, on the Art of Roughness.

Julia, and Julia, and still more Julia….

Let us head off to https://mathigon.org/course/fractals/mandelbrot and play with some iterated functions in the Complex Plane. This will lead us into an intuitive understanding of Julia and Mandelbrot Fractals.

Now we are ready(?) to understand this video on Julia fractals!

Designing with Julia/Mandelbrot fractals

Let us play with this interactive Mandelbrot-Julia combination diagram!

  1. We now that the Mandelbrot fractal uses the Iterated Function \(z \leftarrow ~ z^2 + C\), where \(C\) is a starting complex constant.
  2. The Mandelbrot (at left) is plotted in a coordinate space for \(C\).
  3. The Julia(s) (at right) are plotted in a coordinate space for \(z\).
  4. Depending upon the starting value of \(C\) in the Mandelbrot we get a different choice of Julia fractal in the right side diagram.
  5. In this “single-colour” Mandelbrot, we see that for those values of \(C\) where the corresponding Julia is connected, the \(C\) point is coloured black in the Mandelbrot. Else it is coloured white and appears to be “outside”.
  6. Place your cursor inside the Julia diagram. A connected Julia always shows an iterative trace that lies within itself. A dis-connected Julia has points going off to infinity…
  7. Varying \(C\) we see a systematic variation of the attainable Julia fractals.

Jewellery Shopping with Mandelbrot

Ever gone shopping for jewellery? How is the place organized? That is a good metaphor for how Mandelbrot Set is generated!! Here is an image to complete the Jewellery Store metaphor:

Figure 1: Mandelbrot and Julia Mapping

Fractals with Code

  • Using p5.js
  • Using XaOS

And here is the Julia set:

See also this sketch for a static Julia, set by a user choice of \(C\). https://editor.p5js.org/AhmadMoussa/full/nDrd9EfHr

Let us use the XaOS software to make different kinds of fractals. A sample screen to explore the Mandelbrot fractal is here:

Wait, But Why?

  • Fractal shapes are all around us in nature
  • These mathematically created fractal shapes can have uses that are limited only by your imagination: want to design footwear that does not slip?
  • Different parts of the Mandelbrot fractal allow us to contemplate a variety of fractal shapes
  • And if we choose a different IFS function (rather than \(z \rightarrow z^2 + C\)), we can think of entire families of shapes!

References

  1. An Intrepid Tour of the Complex Fractal World using Dark Heart Package 2.2.0 for Mac. https://dhushara.com/DarkHeart/#Anchor-Introduction-35326
  2. Gary William Flake.(28 August 1988) The Computational Beauty of Nature. ISBN: 978-0262062008. MIT Press.
  3. Batty, M. and Longley, P. A. (1994) Fractal Cities: A Geometry of Form and Function, London: Academic Press, 1994.
  4. Wang H, Luo S, Luo T. Fractal characteristics of urban surface transit and road networks: Case study of Strasbourg, France. Advances in Mechanical Engineering. 2017;9(2). doi:10.1177/1687814017692289
  5. Larry Riddle.Classic Iterated Function Systems. https://larryriddle.agnesscott.org/ifs/ifs.htm
  6. Turtle Graphics in R: https://cran.r-project.org/web/packages/TurtleGraphics/vignettes/TurtleGraphics.pdf
  7. https://www.reddit.com/r/CitiesSkylines/comments/9r0y4e/grid_idea_im_working_on_fractal_squares/
  8. Menger Sponge: https://blogs.scientificamerican.com/roots-of-unity/a-few-of-my-favorite-spaces-the-menger-sponge/
  9. http://fractalfoundation.org/resources/fractal-software/
Back to top

Citation

BibTeX citation:
@online{2024,
  author = {},
  title = {Fractals},
  date = {2024-05-02},
  url = {https://mathforcoders.netlify.app/content/courses/MathModelsDesign/Modules/25-Geometry/30-Fractals/},
  langid = {en},
  abstract = {A Geometric Jewellery Store}
}
For attribution, please cite this work as:
“Fractals.” 2024. May 2, 2024. https://mathforcoders.netlify.app/content/courses/MathModelsDesign/Modules/25-Geometry/30-Fractals/.
Complex Numbers
Affine Transformation Fractals

License: CC BY-SA 2.0

Website made with ❤️ and Quarto, by Arvind V.

Hosted by Netlify .