Skip to content

Lesson 27: Fractal tree

A tree made of trees

  • Look at a real tree: each branch looks like a small tree, and its branches look like even smaller trees.
  • A shape that is made of smaller copies of itself is a fractal.
  • To draw it, write a function that calls itself: draw the trunk, then draw two smaller trees on top.

Words for this lesson

Word Meaning
fractal a shape made of smaller copies of itself
recursion a function that calls itself
base case when the function stops calling itself
depth how many levels are left

Log in or create account

IGCSE, A-Level & AP