Gravity laboratory.
A toy to play with gravity.
The orbits are rendered using Euler's integration, and pre-orbit rendering (while placing body) is calculated by Verlet's integration.
- Create objects and set position and velocity using mouse.
- Modify mass, velocity vector (x and y components), position, diameter and color for each body.
- Two presets with Sun and Earth parameters.
- Modify G.
- Set scale, velocity scale, grid and time scale.
- Create bodies providing mass, velocity and position parameters.
- Pre-draw orbits while placing the body.
- Trace orbits.
- Infinite universe.
- Change body values in real time.
- Body's gravity enable/disable.
- Install Nodejs
- Browser with HTML5 support.
- CD to project directory. Install dependencies.
npm install
- Build
npm run dist
- Run
Open index.html in your browser, or run
npm run watch
This last command will open a browser and will load index.html automatically.
Gravity-lab is licensed under the MIT license. (https://opensource.org/licenses/MIT)