Skip to content

A simple physics simulation to observe the effect of Newtonian gravity on a multi-body simulation

License

Notifications You must be signed in to change notification settings

apholden/gravity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gravity

A simple physics simulation to observe the effect of Newtonian gravity on a multi-body simulation

In its current form, it places 3 stationary masses in a 2 x 1 meter space and simulates Newtonian gravity to accelerate them toward each other. The simulation takes 10-millisecond steps and runs for 1,000,000 steps. It prints the position and velocity of the objects every 10,000 steps.

Using this, I was able to observe the velocities change direction over time, implying that 3 bodies, placed in an asymetric pattern, is enough to introduce angular momentum.

To compile this code, it depends on the Boost Libraries, specifically the math constants and multiprecision libraries.

About

A simple physics simulation to observe the effect of Newtonian gravity on a multi-body simulation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages