Directory |
---|
🎓 About The Class ℹ About The Sketches 🎨 The Different Sketches |
I took this class in my Senior year of college, and it explored all the cool math that computers use. This class is a “Specialty course” at Miami. What this means is it isn’t a regularly offered course. Instead, my professor designed the study and got it approved by the department to teach as an elective. We used a very lightweight online IDE called p5js, which allowed us to explore many concepts. Everything from different geometries, fractals, the time complexity of algorithms, cryptography, and image processing. Overall, I always had something to look forward to in this class. We covered so many different topics within computer science I never got bored of it. I would recommend this type of course to any university student studying computer science. It was a blast.
I can give context to the many different topics in this repo. When covering these topics, we would start a new sketch in p5js. This lightweight IDE allowed us to demonstrate each idea to its fullest potential in a two-to-three-week time frame. I tried to include cryptography and different time complexities, but it’s difficult to show since there aren’t many visuals. Nevertheless, each sketch below should have a link that you can explore and experiment with; just click each link and hit the play button in p5js!
Imagine you have a square 12-inch wooden board and hammer 30 nails into the board in random locations. Then, finally, you take a big rubber band to encompass all of the nails on the board. That's the general idea of a convex hull algorithm, also known as a gift wrapping algorithm. Physic simulation and image processing have a lot of possibilities for the convex hull algorithm. As for my sketch, you move the slider back and forth to change the number of random points generated for the algorithm. Have fun!
Julia sets are more a function rather than an image. This mathematical function uses complex numbers and iterated functions to decide the colors of each pixel in the picture. The x-axis represents the real number, and the y-axis represents the imaginary numbers. Let’s run down how it works from start to finish. Here is how the algorithm decides one pixel/point on the image. You take the complex number and run it through the function a certain number of times; we call this our bailout value. If that point has escaped to infinity, we will show it red; otherwise, we would show it as blue/green. We would do this for every complex number within the domain, and thus our image is developed! You can learn more about them here. As for my sketch, you can change the slider to adjust the bailout value. Also, dragging your cursor over the image will show where each point goes after each iteration. Finally, you can click anywhere on the image to change the complex number added to the function. Have fun, and see what fun pictures you can make!
L-Systems are unique because it relates to different code language grammar. There is a starting point and other rules. You would look through each character in the string for every iteration and change that character based on the rules. For example, a rule turning “A” into “BB” would end up as “BBBB” after one iteration. So, where this relates to visuals and images, each letter in the string represents a different operation. For example, A means turn left, B means move forward, C means branch off, etc. Based on the rules and what each letter means, you can get some pretty sweet images to show up. My sketch has seven relatively well-known LSystems that you can change how many iterations it performs with the slider. Go check them out!
This last section is like a catch-all to all the miscellaneous stuff we did throughout the year. I got enlightenment on how games develop and produce images from code. For example, in plant images in video games that have an open world, code could create many plants within that game rather than a pre-saved image of the plant. The sketch link I included is a concise code snippet that creates a 3D-looking tunnel effect. When you play games of how much stuff, even visual, is developed from code, you would be surprised. Overall really cool stuff. When running the sketch, you can move your cursor around and get an enjoyable tunnel effect.