Skip to content

Instantly share code, notes, and snippets.

View marten-voorberg's full-sized avatar

Marten Voorberg marten-voorberg

View GitHub Profile
@marten-voorberg
marten-voorberg / Vector3.py
Last active October 5, 2020 19:09
Vector3 Class Python
import math
class Vector3:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
# Used for debugging. This method is called when you print an instance
def __str__(self):
@marten-voorberg
marten-voorberg / body2.py
Created October 4, 2017 11:38
Blablabla
import math
def calc_gravitational_force(mass1, mass2, distance):
if distance == 0:
return 0
return 6.67e-11 * mass1 * mass2 / distance ** 2
class Vector2:
def __init__(self, x, y):