xgi / gravity-sim

Newtonian gravity simulator

Home Page:https://xgi.github.io/gravity-sim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

A rudimentary Newtonian gravity simulator. Allows the user to create a system of particles which are attracted to each other using Newton's law of universal gravitation.

Controls:

click - create a particle.

click + drag - create a particle with initial velocity.

shift + drag - pan the camera.

up arrow - double the current mass.

down arrow - halve the current mass.

left arrow - increase the gravitational constant.

right arrow - decrease the gravitational constant.

f - focus the viewport on the most massive particle. This particle will have its velocity forced to zero to make the velocities of other particles relative to it.

v - draw helper lines on all particles showing their velocity.

About

Newtonian gravity simulator

https://xgi.github.io/gravity-sim


Languages

Language:JavaScript 84.4%Language:HTML 12.7%Language:CSS 3.0%