Skip to content

Instantly share code, notes, and snippets.

@benrules2
Last active November 15, 2016 23:14
Show Gist options
  • Select an option

  • Save benrules2/03c8c23ddd3a255954129b07081d4a2f to your computer and use it in GitHub Desktop.

Select an option

Save benrules2/03c8c23ddd3a255954129b07081d4a2f to your computer and use it in GitHub Desktop.
Python N-Body Orbit Simulation
def update_location(bodies, time_step = 1):
for target_body in bodies:
target_body.location.x += target_body.velocity.x * time_step
target_body.location.y += target_body.velocity.y * time_step
target_body.location.z += target_body.velocity.z * time_step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment