Last active
November 15, 2016 23:14
-
-
Save benrules2/03c8c23ddd3a255954129b07081d4a2f to your computer and use it in GitHub Desktop.
Python N-Body Orbit Simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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