Skip to content

Gravity simulation following Newton's equation for universal gravitation; written in HTML, CSS and Javascript.

License

Notifications You must be signed in to change notification settings

nicolasspaniol/gravity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gravity

Gravity simulation following Newton's equation for universal gravitation: $F = G {m_1 m_2 \over r^2}$.

By default, the simulation loads an inital state with some planets orbiting a star, stored as system.json. New bodys can be added by holding LMB and dragging to the opposite direction you want the body to be moving to, with the amount of force applied depending on the dragged distance multiplied by a factor that can be modified on the options panel. The size, density and color of new bodies can also be changed.

The page needs to be served by a web server to access the system.json file and, therefore, to work properly. For VS Code, an extension like Live Server will do the trick.

About

Gravity simulation following Newton's equation for universal gravitation; written in HTML, CSS and Javascript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published