CodersAdvocate

I work hard, so you don't have to

Javascript Powered Law Of Universal Gravitation

 

I've always wanted to make real physics work using programatic code. This is the universe in small balls in Javascript!
As you probably know.. the universe started with a big bang.. so press the big bang button below to being the universe.

Choose speed
Merge Collisions

Notes of interest

I find this quite facinating to watch. notice how the gravitational swings pulls the points off the screen when more than one big object compete for the gravitational power!

What is the jumps when the elements touch?
Well the short answer is that is the gravitational sling shot. If this was programmed in 3 dimensional space, you would see the elements falling in to orbit around each other.

How comes the elements go off screen?
When the sling shot is too big it can sometimes shoot the elements off the screen, and if the acceleration was too great, each others gravity could break the gravitational pull of the other, and push each other off the display. They still exist, just not in the view port I have used!

How comes the elements go off screen?
When the sling shot is too big it can sometimes shoot the elements off the screen, and if the acceleration was too great, each others gravity could break the gravitational pull of the other, and push each other off the display. They still exist, just not in the view port I have used!

Copyright 2011 CodersAdvocate ©