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

starting work on moment of inertia calculator

This commit is contained in:
Anson 2020-03-04 00:15:14 -07:00
parent 3371569771
commit 1b6f3c9cb7

View 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)