Jim's
Tutorials

Spring 2019
course
site

I had an exam over the weekend again, so I didn't get as much done as I'd like. At this point I don't really have specific questions or issues, I just need to spend some more time working on this.

I tried starting to implement your suggestion for particles bouncing off of walls, but I couldn't figure out the corners. Instead I just made it so that if a particle goes off the maximum it reappears at the minimum. Not exactly the most physical solution, but I really only care about the interaction between the small particle and the large one so as long as the particles don't fly off to infinity or get completely messed up it is fine.

I have begun to implement tests in my functions. So far they aren't completely exhaustive, but they have helped me find some of the more major bugs. The reason I kept getting the square root of a negative when I was trying to find when the particle intersected was because of a misplaced '+'. I added the square of the radius where I should have subtracted it and that messed up the whole thing.

The other major bug I was having, where I would get infinite velocities after a collision, was apparently due to the fact that I had accidentally used a velocity instead of mass when trying to find the center of mass frame of reference. I still need to implement more tests with that one however, as I'm not certain it's working properly.

Something is still broken in my test of everything, I think it is the velocity exchange function, but it's entirely possible that the problem is in how I set up the test.

https://cs.marlboro.college /cours /spring2019 /jims_tutorials /jtuttle /apr2
last modified Fri May 3 2024 7:56 pm