Skip to content

Simulates the gravitational interactions between objects, e.g. planets around a star.

License

Notifications You must be signed in to change notification settings

rsdc2/laws-of-motion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laws of motion

Overview

This simulates the gravitational attraction between multiple bodies. It runs entirely in the browser.

With the default settings it simulates the orbits of the inner planets, i.e. Mercury, Venus, Earth and Mars, around the Sun. It is possible to modify the attributes of these planets (initial speed, direction, mass and location), as well as to introduce new objects.

Run from GitHub Pages

Follow this link https://rsdc2.github.io/laws-of-motion/.

Run locally

  1. Install http-server for serving the code locally.
npm install
  1. Serve locally:
npx http-server
  1. Load in browser:

e.g.

http://localhost:8080

Usage instructions

  • To modify initial parameters for the objects, click Modify initial parameters, and change the details in the appropriate cells of the table.
  • To reset to initial settings, click Reset.
  • To pause the simulation, click Pause.
  • To restart the simulation, clikc Start.

Dependencies

The only dependency is http-server (MIT license) for serving the code locally.

About

Simulates the gravitational interactions between objects, e.g. planets around a star.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published