P.S. you could also add something to the position (+random(-9,9)); in fact, the initial image from your teacher might suggest there is in fact a small ring in the center the leafs grow out of, because the leafs don’t really touch in the center. But that is only speculation.
when we pass i as the angle to the function it is from 0 to 71
since rotate expects the angle in radians (between 0 and 2 PI)
we should say rotate(radians(angle)) - but the the call with i doesn’t make sense then anymore.
You can use i * (360 / 72) for example or random(360) I think
There is a lot there to absorb so focus on the *missing elements.
There are tutorials and examples that piece it all together.
Part of learning to code is understanding the flow of the program and each element of your code.
I use the Processing resources and references all the time and learn something new with each visit.
If you are using the Processing IDE (3.5.4 or 4) use can also right click on a keyword and select “Find in Reference”. The website is updated and may have more links and visuals with examples.
In this case adding a random(-9, 9) to x or y will offset the center of rotation randomly.
I’ll stop there and will not share any examples for this homework topic.
Less is more… especially when helping beginners and especially so for a homework question.
In general, you can modify all the elements of the shape; the variables that you are passing and inside the function.
New programmers need to engage their brains and focus on the immediate task and learning outcomes. Speculation with a specific case may lead them down the wrong path and not achieve the expected results… exploration on the other hand is an adventure.
There is a lot that can be done with this basic code to create cool effects; this may be part of the homework exercise.
This is just using the original code and a few tweaks to modify scale (with a factor) and the use of random() for other elements of the flower without an offset to x or y:
I have made the mistake of providing to much help and usually throttle back these days and temper my enthusiasm… less is more. How much I volunteer to help very much depends on the participant, their experience and how much they are engaging in the topic.