Skip to content

Instantly share code, notes, and snippets.

@benrules2
Last active March 12, 2020 14:31
Show Gist options
  • Save benrules2/d56af486108ce43d6026189816b5851d to your computer and use it in GitHub Desktop.
Save benrules2/d56af486108ce43d6026189816b5851d to your computer and use it in GitHub Desktop.
Python N-Body Orbital Simulation
import math
import random
import matplotlib.pyplot as plot
from mpl_toolkits.mplot3d import Axes3D
class point:
def __init__(self, x,y,z):
self.x = x
self.y = y
self.z = z
class body:
def __init__(self, location, mass, velocity, name = ""):
self.location = location
self.mass = mass
self.velocity = velocity
self.name = name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment