This file contains 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
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): |
This file contains 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
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): |