A Matter of Matter
This was my first real JavaScript project. A small simulation of matter and gravity.
(Press "Solar System" to start)
Description
This program simulates how bodies of specific mass influence each other through gravity. It uses real physics formula and I've tried
to keep it as close to reality as possible.
At the moment you can choose between two "modes": Solar System or Random.
If you press "Solar System" the program will simulate our solar system, including all 8 planets and our sun. The camera will start with
the earth in the middle of the view.
If you press "Random" 20 random bodies are generated (with random mass, velocity and position).
You can exit a mode by pressing the red "X" in the upper left corner.
Beneath each body you can see a yellow number indicating the mass of the object. "e" stands for 10 to the power of the number next to
"e". So 5e10 would be 5*10^6 which would be 5 million kilograms.
At a zoom-level of x1 one pixel on your screen is equivilant to 1000 km. If the mode is set to random all object sizes are calculated as if
they had the same density as earth.
Instructions
You can move the camera view with AWSD.
The Buttons "<<" and ">>" in the top right corner control the speed of time (you can see the elapsed time in the upper left corner).
The Buttons "+" and "-" in the bottom right corner control your zoom level.
Time of Development:
Early 2016