# Does anyone know how to draw a small firework using Processing?

**URL:** <https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794>\
**Category:** Coding Questions\
**Created:** [October 13, 2021, 6:52am UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794 "2021-10-13T06:52:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SantosCuccia](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@SantosCuccia](https://discourse.processing.org/u/SantosCuccia)\
**Post date:** [October 13, 2021, 6:52am UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/1 "2021-10-13T06:52:59Z")

</div>

Does anyone know how to draw a small firework using processing?

![1616188254361](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f97fb679975889f87fbf92e398008b8b7f92294c.png)

---

<div class="post-metadata">

**Author:** ![SantosCuccia](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@SantosCuccia](https://discourse.processing.org/u/SantosCuccia)\
**Post date:** [October 13, 2021, 6:54am UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/2 "2021-10-13T06:54:17Z")

</div>

![1616188280331](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d385c991ca21e4424e8e92930efefc0efe22368f.png)

---

<div class="post-metadata">

**Author:** ![MiguelSanches](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/miguelsanches/32/11172_2.png) [@MiguelSanches](https://discourse.processing.org/u/MiguelSanches)\
**Post date:** [October 13, 2021, 8:48am UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/3 "2021-10-13T08:48:12Z")

</div>

Hi @SantosCuccia ,

Maybe this helps:

[![](https://img.youtube.com/vi/CKeyIbT3vXI/hqdefault.jpg "Coding Challenge #27: Fireworks!") ](https://www.youtube.com/watch?v=CKeyIbT3vXI)

[https://thecodingtrain.com/CodingChallenges/027-fireworks.html](https://thecodingtrain.com/CodingChallenges/027-fireworks.html)

---

<div class="post-metadata">

**Author:** ![ams](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ams/32/17286_2.png) [@ams](https://discourse.processing.org/u/ams)\
**Post date:** [October 28, 2022, 10:57pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/4 "2022-10-28T22:57:23Z")

</div>

hey did u end up solving how to do it?

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 28, 2022, 11:16pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/6 "2022-10-28T23:16:10Z")

</div>

> [@ams](#):
>
> hey did u end up solving how to do it?

Hi and welcome

> <https://github.com/CodingTrain/Coding-Challenges/tree/main/027_FireWorks>
>
> //github.com/CodingTrain/Coding-Challenges/tree/main/027\_FireWorks

---

<div class="post-metadata">

**Author:** ![ams](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ams/32/17286_2.png) [@ams](https://discourse.processing.org/u/ams)\
**Post date:** [October 29, 2022, 12:08pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/7 "2022-10-29T12:08:29Z")

</div>

I was looking for an example with no arrays

---

<div class="post-metadata">

**Author:** ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)\
**Post date:** [November 2, 2022, 1:00pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/8 "2022-11-02T13:00:18Z")

</div>

Hi @ams I’d suggest you post a new topic with your question and share the code you have already written. Please read the [guidelines on asking questions](https://discourse.processing.org/t/guidelines-asking-questions/2147/8) and don’t forget to add the `Homework` tag to your post 😉

---

<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:** [November 2, 2022, 1:21pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/9 "2022-11-02T13:21:59Z")

</div>

It’s a little difficult without arrays.

You would need for each particle/ shrapnel  
x1,y1 pair and x2,y2 pair and so on

---

<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:** [November 2, 2022, 1:49pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-draw-a-small-firework-using-processing/32794/10 "2022-11-02T13:49:04Z")

</div>

OR you do it in a for loop and esch iteration represents one shrapnel

Then calculate with increasing radius and angle and cos and sin
