1
0
mirror of https://gitlab.com/MisterBiggs/aero-astro-calc.git synced 2025-06-16 15:17:18 +00:00

15 lines
450 B
Python

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)