An open API service indexing awesome lists of open source software.

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

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

![demo](img/demo.gif)