Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    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.

    Attached Files Attached Files


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts