https://github.com/microhod/gravityjs
Simple newtonian Gravity simulator as a static website
https://github.com/microhod/gravityjs
gravity html javascript simulation
Last synced: 5 months ago
JSON representation
Simple newtonian Gravity simulator as a static website
- Host: GitHub
- URL: https://github.com/microhod/gravityjs
- Owner: microhod
- License: mit
- Created: 2020-12-13T14:12:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T09:23:21.000Z (over 2 years ago)
- Last Synced: 2024-03-16T11:04:55.589Z (over 2 years ago)
- Topics: gravity, html, javascript, simulation
- Language: JavaScript
- Homepage: https://gravity.microhod.com
- Size: 3.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GravityJS
Simple newtonian Gravity simulator as a static website, using a [html canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) and [the Newtonian Gravitation equation](https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation).
## Use
Go to http://gravity.microhod.com
## Run
1. [Install NodeJS](https://nodejs.org/) following the instructions on their website.
2. Clone this repository
3. Run `npm install` in this repository
4. Run `npm start` and it should be running at `localhost:8080`
> Note: you can also debug in vscode. Use the `live server` extension to run the server and then you can debug in vscode using chrome (check they're pointing to the same localhost port).
## Demo
> Note: animation is smoother than it appears, the gif just isn't great
