mirror of
https://gitlab.com/MisterBiggs/aero-astro-calc.git
synced 2025-06-16 15:17:18 +00:00
starting work on moment of inertia calculator
This commit is contained in:
parent
3371569771
commit
1b6f3c9cb7
14
aero_astro_calc/Inertia.py
Normal file
14
aero_astro_calc/Inertia.py
Normal file
@ -0,0 +1,14 @@
|
||||
from typing import Tuple
|
||||
|
||||
|
||||
class Inertia:
|
||||
def __init__(self, area: float, centroid: Tuple[float, float]):
|
||||
self.area = area
|
||||
self.centroid = centroid
|
||||
|
||||
def __add__(self, other):
|
||||
AX = self.area * self.centroid[0] + other.area * other.centroid[0]
|
||||
AY = self.area * self.centroid[1] + other.area * other.centroid[1]
|
||||
self.area = self.area + other.area
|
||||
self.centroid = (AX / self.area, AY / self.area)
|
||||
|
Loading…
x
Reference in New Issue
Block a user