# Help with complex homework(Solved)

**URL:** <https://discourse.processing.org/t/help-with-complex-homework-solved/32837>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 14, 2021, 10:03pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837 "2021-10-14T22:03:03Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 14, 2021, 10:44pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/21 "2021-10-14T22:44:06Z")

</div>

Yeah and alpha (how dark the leafs look)

I leave you alone with that now, but good job!

Also, welcome to the forum!

Warm Regards,

Chrisir 😉

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.

---

<div class="post-metadata">

**Author:** ![Onipunch777](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/onipunch777/32/14715_2.png) [@Onipunch777](https://discourse.processing.org/u/Onipunch777)\
**Post date:** [October 14, 2021, 10:46pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/22 "2021-10-14T22:46:03Z")

</div>

thank you very much and I was hoping if you’re able to help me with another later around 6:30 pm today. If possible.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 14, 2021, 10:46pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/23 "2021-10-14T22:46:59Z")

</div>

post a new discussion then, it depends a bit of the time zone.

I or others will help.

😉

---

<div class="post-metadata">

**Author:** ![Onipunch777](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/onipunch777/32/14715_2.png) [@Onipunch777](https://discourse.processing.org/u/Onipunch777)\
**Post date:** [October 14, 2021, 10:47pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/24 "2021-10-14T22:47:43Z")

</div>

thank you very much hope you have a great day.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 14, 2021, 10:57pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/25 "2021-10-14T22:57:01Z")

</div>

**The angle**

> [@Chrisir](#):
>
> angle the angle of the leaf (between 0 and 2 PI)

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

not tested

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 14, 2021, 11:32pm UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/26 "2021-10-14T23:32:45Z")

</div>

Hello @Onipunch777,

There are tutorials, resources and examples here:

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts…

I would look up the references for each of these to understand each element of the code:

setup()  
size()  
noLoop()  
draw()  
background()  
noStroke()  
for()  
\*fill()  
\*translate()  
\*rotate()  
\*scale()  
beginShape  
vertex()  
bezierVertex()  
endShape  
popMatrix()

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.

`:)`

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 16, 2021, 11:23am UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837/27 "2021-10-16T11:23:19Z")

</div>

> [@Chrisir](#):
>
> 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.

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_:

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5c09c3bdc944920dca75da67a9b3abd034994e3b.png)

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.

`:)`

[Previous page](https://discourse.processing.org/t/help-with-complex-homework-solved/32837.md?page=1)
