At My Fingertips

Let's create a mandala that looks like a flower.

The mandala flower is made up of many dots. The larger dots are not just plain circles, but they have a bit of a 3-d effect:

Loading...

Let's create a function that can compose a ring of dots.
If you are not sure how to implement this function, check the **Sliced Pitaya** activity.

Loading...

Now let's compose a mandala from multiple concentric rings of dots.

Here is a function to compose a list of graphics. We will use this to compose a list of concentric rings into a mandala.

Loading...

Now implement the `mandala`

function below to compose a mandala like this:

This mandala consists of 6 outer rings, 6 middle rings, 2 inner rings, and a central circle. The outer and middle rings consist of 20 dots. The 2 inner rings consist of 20 circles. The color of the outer rings has a saturation of 1.0, the middle rings of 0.75, and the inner rings and circle of 0.5.

You can compute the diameter of the i-th ring with `largest_ring_diameter * base ** i`

,
where the largest ring is the 0-th ring,
and `base`

is a number smaller than 1 (e.g., 0.875).

Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Mandala Flower

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy Policy • Platform Version c3a8286 (Mon, 14 Oct 2024 13:30:28 GMT)