Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Particle Physics Equations
06-14-2007, 02:29 AM #1
- Join Date
- Oct 2006
- Thanked 0 Times in 0 Posts
Particle Physics Equations
Inspired by Gravitas, I decided to make a similar simulation in JS, visualized with the canvas element. It's pretty nice, albeit slow (I can run about 10 particles max before it gets choppy), but the particles simply don't behave as those in the Gravitas videos do. That they don't merge together is my main concern.
I've tried to code the equations as accurately as possible to real physics equations. The code is attached, run ParticleSystemTEST.html to see it in action. The equations/gravitational constants are mostly in ParticleSystem.prototype(.updateGravity), Particle.get(Displacement|VelocityChange)After, and Vector.getAccelerationOf.
If someone with physics knowledge would look at this (I think/hope its sufficiently commented) and suggest changes, I would appreciate it. Also, speed optimization would be nice, too.