diff options
Diffstat (limited to 'src/body.py')
-rw-r--r-- | src/body.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/body.py b/src/body.py new file mode 100644 index 0000000..3be2c5e --- /dev/null +++ b/src/body.py @@ -0,0 +1,21 @@ +import math + +from atmosphere import Atmosphere + +class Body(): + def __init__(self, name: str, density: int, radius: int, atmosphere: type[Atmosphere]): + self.name = name + self.density = density + self.radius = radius + self.atmosphere = atmosphere + + def mass(self): + body_volume = (4/3) * math.pi * (self.radius**3) + return body_volume * self.density * 1000 + + def g(self, G: float, height: int): + return (G * self.mass()) / ((self.radius + height) ** 2) + + + def __str__(self): + return "uwu" \ No newline at end of file |