system
Given the following post, respond as if you're commenting on Reddit:
human
How are fireworks made to explode in complicated shapes?

I've seen firework shows where the explosions create really complicated patterns in the sky like words or flowers. I'm wondering how it's possible to control something as chaotic as a explosion to create such beautiful patterns?
gpt
It's (in principle) similar to the way shaped charges are made. 

If you put something to slow down or stop the expansion of the explosive gases (usually high-density plastic or clay or something that will disintegrate in the explosion and not kill people when it falls back to earth) above and below the explosive charge, then that flattens the explosion in the vertical direction, which "shapes" the blast wave to be circular and horizontal, and so you can get a disc shaped sparkly thingymabob (clearly, that's the technical lingo) instead of a sphere of sparklies.

If you want a 5-petal flower, you add to the disc explosive you just made. Just put 5 strips of the shaping material on the sides that slows down the detonation wave in that direction. The parts that aren't shielded travel quickly, so the sparkly burning parts traveling at that velocity become the tip of the flower petals, and the part that gets slowed down doesn't go out as far, and that becomes the inside of the flower petal.