2D Collision Simulation
You can now get the code off Github!
Intro
This is a Java program that simulates collisions between polygons. I wrote this for physics during my junior year in high school. The project involved more than just writing a program—we also had to write a paper and perform some physical experiments.
I worked with a team of three other students for this project. However, only Jessica Taylor helped with the programming; the others worked on things like the physics experiment and presentation.
Jessica primarily worked on the actual physics, using Newton’s method to approximate the change at each step and even deriving how torque worked from basic principles (We hadn’t covered torque at all in class.)
I worked on the user interface and putting everything together. To make the design more module, I used the observer pattern—everything has to be a pattern in Java, after all.
The code was actually fairly reusable. We even used the physics engine to write a pong game with oddly shaped paddles where the ball actually followed the laws of physics! And, perhaps surprisingly for high school, most of the code is fully document with Javadocs.
Powerpoint
As part of the project, we had to make and present a powerpoint presentation on the simulation. The slides give a good overview of the whole project. The presentation is available in pdf and ppt.