Using matrices to make fractals

Screen Shot 2023-11-01 at 3.27.10 PM

Using matrices to make fractals

We start with a triangle ABC, with coordinates 𝐴(0,0) , 𝐵(1,0) , 𝐶( 0,1) as shown above.  We can this triangle F_0 and we then write this as the following matrix:

Screen Shot 2023-11-01 at 3.31.19 PM

We then have the following algorithm to generate the next triangle F_1.

Screen Shot 2023-11-01 at 3.31.31 PM

In effect this means that the triangle F_1 is made by combining the coordinates from F_1a, F_1b and F_1c.  So we now need to know how to make these.  F_1a is given by:

Screen Shot 2023-11-01 at 3.31.40 PM

This is a transformation which takes the original coordinate points and enlarges them by a scale factor of 1/2 centered at the origin.

F_1b is given by:

Screen Shot 2023-11-01 at 3.31.52 PM

This is a transformation which takes the original coordinate points and enlarges them by a scale factor of 1/2 centered at the origin and then translates them to the right by 1/2.

F_1c is given by:

Screen Shot 2023-11-01 at 3.32.04 PM

This is a transformation which takes the original coordinate points and enlarges them by a scale factor of 1/2 centered at the origin and then translates them down by 1/2.

So this tells us the 9 coordinates of the new triangle:

Screen Shot 2023-11-01 at 3.32.22 PM

Plotting this then gives:

Screen Shot 2023-11-01 at 3.32.27 PM

We notice that we have 3 copies of our F_0 image.

The next iteration

We can continue this process.  F_2 is given by:

Screen Shot 2023-11-01 at 3.32.43 PM

Where F_2a follows the same pattern as before:

Screen Shot 2023-11-01 at 3.32.49 PM

We take all the previous 9 coordinates and scale them by a factor of 1/2 centred the origin.

And F_2b, F_2c also follow the same pattern:

Screen Shot 2023-11-01 at 3.32.59 PM

Screen Shot 2023-11-01 at 3.33.04 PM

Plotting the next iteration

Screen Shot 2023-11-01 at 3.33.10 PM

This now gives 27 coordinates which we plot above.  We can already start to see the fractal nature of the design appear. 

We can see that we now have 3 copies of our previous F_1 image. Continuing this would then create a fractal design similar to the Sierpinski triangle. The Sierpinski triangle is based on a equilateral triangle rather than a right angled triangle and is shown below:

Screen Shot 2023-11-01 at 3.33.22 PM

You can explore the Python code needed to generate this image – and run your own versions here.  (You need to click run and then click on the graph png).

IB teacher? Please visit my new site http://www.intermathematics.com ! Hundreds of IB worksheets, unit tests, mock exams, treasure hunt activities, paper 3 activities, coursework support and more. Take some time to explore!

Andrew Chambers: (Resources for IB teachers)

Please visit the site shop:  http://www.ibmathsresources.com/shop to find lots of great resources to support IB students and teachers – including the brand new May 2025 prediction papers.

Andrew Chambers (Resources for Students)

Comments are closed.

Powered by WordPress.com.

Up ↑