blob: 3be2c5e211dbe436e1cb7b9a00d88684ac71ff5b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"
|