A butterfly curve sketch drawn with p5.js for practice with parametric equations in creative programming.
The butterfly curve is an aesthetically pleasing transcendental plane curve and one of my favorite mathematical equations to turn into code. It took time for me to convert the equations into Javascript and then again with the p5.js library, but overall this exercise was fairly simple!
To learn more about the butterfly curve, visit Wikipedia and MathWorld. These informative sites helped me a bunch, but there were moments when I needed additonal help and had to research furthur. In these moments, I ran to The Coding Train and watched a few resourceful videos on the specific problems I was facing. There are so many helpful tutorials to choose from, but I found these couple videos to help me the most with this project: Polar Coordinates and Mathematical Rose Patterns
Finally, I was playing around with 3D shapes when I accidently developed the look of a gradient background by using a torus shape and enlarging it. I love the use of the torus with the butterfly sketch!
See the Pen Butterfly Curve by Lexi ♡ (@huesofheart) on CodePen.