Newtonian Orbit

See inside

Use Newtonian gravity F = G M m / r^2 to calculate acceleration and velocity to update star's and planet's position.

Different orbits can be obtained by adjusting velocties (vx_*, vy_*) of the star and the planet. You should click on See Inside to move the star and the planet around.

Example settings at these YouTube videos: (Star is 1000 times the mass of planet) (Star and planet have about the same mass) (Using star for gravity assist)

Notes and Credits

Calculate the gravitational force between a star and a planet which depends on star's mass, planet's mass, and the distance between the star and the planet.

Calculate acceleration of star and planet which is the gravitational force divided by mass

Use the acceleration to update the velocity of star and planet.

Use the velocity to update the positions of star and planet.

The above calculations involve solving differential equations. We solve them numerically using Euler method ( or midpoint method ( for better accuracy.

Shared: 28 May 2018 Modified: 1 Jun 2018
Favorite this project 1
Love this project 2
Total views 41
View the remix tree  1
More projects by psaipetc