Final Optimized Version
A java applet demonstrating the motion of particles(molecules) in a gaseous environment.
All collisions are assumed to be frictionless, i.e. no energy is lost on any impact.
Requires Java Runtime v1.4.1Known bugs/glitches:
- Note: When changing the number of particles, press enter after typing in the new value.
- Not verified, but it might be possible for the particles to 'elude' the collision checking routine, thus passing from top of each another.
- Depending on the maxParticleSpeed value, the velocity vectors can be above 1.0f, which is not a good thing.
- Uses a HUGE amount of memory (~16MB in applet viewer and 7-11MB in explorer window) considering the size of the applet. Also leaks, because Java uses internal garbage collect (can't use delete)
- Bouncing algorithm is not perfect - it's designed to be a fast and simple method to calculate resulting angles
- Sometimes can cause a NullPointerException when increasing the number of particles